blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f6b0043c57266cb73d5bfed86c83895be9fe396b | 4d4822b29e666cea6b2d99d5b9d9c41916b455a9 | /Example/Pods/Headers/Private/GeoFeatures/boost/geometry/multi/algorithms/remove_spikes.hpp | 96bfa1b9c53e63ec90436116074af98f2960410b | [
"BSL-1.0",
"Apache-2.0"
] | permissive | eswiss/geofeatures | 7346210128358cca5001a04b0e380afc9d19663b | 1ffd5fdc49d859b829bdb8a9147ba6543d8d46c4 | refs/heads/master | 2020-04-05T19:45:33.653377 | 2016-01-28T20:11:44 | 2016-01-28T20:11:44 | 50,859,811 | 0 | 0 | null | 2016-02-01T18:12:28 | 2016-02-01T18:12:28 | null | UTF-8 | C++ | false | false | 88 | hpp | ../../../../../../../../../GeoFeatures/boost/geometry/multi/algorithms/remove_spikes.hpp | [
"hatter24@gmail.com"
] | hatter24@gmail.com |
cc38085f77287d06fa5622aa5d375c4e40b8f94a | 83bacfbdb7ad17cbc2fc897b3460de1a6726a3b1 | /third_party/WebKit/Source/core/layout/ClipRect.cpp | 48f1e01c3d3c950196fe6622eb232113b190256a | [
"Apache-2.0",
"BSD-2-Clause",
"LGPL-2.1-only",
"LGPL-2.0-only",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LicenseRef-scancode-other-copyleft"
] | permissive | cool2528/miniblink49 | d909e39012f2c5d8ab658dc2a8b314ad0050d8ea | 7f646289d8074f098cf1244adc87b95e34ab87a8 | refs/heads/master | 2020-06-05T03:18:43.211372 | 2019-06-01T08:57:37 | 2019-06-01T08:59:56 | 192,294,645 | 2 | 0 | Apache-2.0 | 2019-06-17T07:16:28 | 2019-06-17T07:16:27 | null | UTF-8 | C++ | false | false | 1,639 | cpp | /*
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "core/layout/ClipRect.h"
#include "core/layout/HitTestLocation.h"
namespace blink {
bool ClipRect::intersects(const HitTestLocation& hitTestLocation) const
{
return hitTestLocation.intersects(m_rect);
}
} // namespace blink
| [
"22249030@qq.com"
] | 22249030@qq.com |
2228540270eb8d2f9bd3baa9eef2d33b3dc2244b | 5f79f9c1feade5b8aa505ce999f78acff1864e7e | /ns-3.20/src/applications/model/trickles-appcont.h | da3f4ba48221cd0a7c6c96cc11b9188b4197ac61 | [] | no_license | dchaly/stateless | 52a26938c0c45e553569eb5e64f7a90fdf0d16e5 | 230344eafa24cc426b3c44b68d84a40125d17fe8 | refs/heads/master | 2021-01-22T07:32:32.845106 | 2015-10-30T09:25:49 | 2015-10-30T09:25:49 | 29,728,783 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,413 | h | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 P.G. Demidov Yaroslavl State University
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Dmitry Chalyy <chaly@uniyar.ac.ru>
*/
#ifndef TRICKLES_APPCONT_H
#define TRICKLES_APPCONT_H
#include "ns3/tag.h"
using namespace ns3;
class TricklesRequestSizeTag : public Tag {
public:
TricklesRequestSizeTag();
void SetRequestSize(uint16_t rqSize);
uint16_t GetRequestSize() const;
static TypeId GetTypeId(void);
virtual TypeId GetInstanceTypeId(void) const;
virtual uint32_t GetSerializedSize(void) const;
virtual void Serialize(TagBuffer i) const;
virtual void Deserialize(TagBuffer i);
virtual void Print(std::ostream &os) const;
private:
uint16_t m_rqSize;
};
#endif
| [
"dmitry.chaly@gmail.com"
] | dmitry.chaly@gmail.com |
24603918be3ecd006da4f36446c27c97b0996f2d | f6ab96101246c8764dc16073cbea72a188a0dc1a | /OnlineJudge/ZEROJUDGE/b208 A. 蜜蜂的約會.cpp | b498b8767d319c71bf104b94352c690fff21ab49 | [] | no_license | nealwu/UVa | c87ddc8a0bf07a9bd9cadbf88b7389790bc321cb | 10ddd83a00271b0c9c259506aa17d03075850f60 | refs/heads/master | 2020-09-07T18:52:19.352699 | 2019-05-01T09:41:55 | 2019-05-01T09:41:55 | 220,883,015 | 3 | 2 | null | 2019-11-11T02:14:54 | 2019-11-11T02:14:54 | null | UTF-8 | C++ | false | false | 709 | cpp | #include <stdio.h>
#include <string.h>
int mapped[262144], LIS[100005];
int main() {
int n, i, x;
while(scanf("%d", &n) == 1) {
memset(mapped, 0, sizeof(mapped));
for(i = 0; i < n; i++)
scanf("%d", &x), mapped[x+100000] = i;
int L = -1, l, r, m;
for(i = 0; i < n; i++) {
scanf("%d", &x);
x = mapped[x+100000];
l = 0, r = L;
while(l <= r) {
m = (l+r)/2;
if(LIS[m] < x)
l = m+1;
else
r = m-1;
}
LIS[l] = x;
if(l > L) L = l;
}
printf("%d\n", L+1);
}
return 0;
}
| [
"morris821028@gmail.com"
] | morris821028@gmail.com |
b96d60f553227b510c31d16cfb745e590cc8f16b | 874124925d861bc8d003f09490d823f44d1b0ca0 | /src/include/Terrain/TerrainOperationEditPoint.hpp | c4250390f92896cb95021d260386c929d1a2c766 | [
"MIT"
] | permissive | foxostro/PinkTopaz | 2e5555b0495e493d3ca8bafbd98dd1b00e099bdd | cd8275a93ea34a56f640f915d4b6c769e82e9dc2 | refs/heads/master | 2021-01-22T22:24:07.097116 | 2018-06-17T04:14:59 | 2018-06-17T04:15:01 | 85,535,947 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,219 | hpp | //
// TerrainOperationEditPoint.hpp
// PinkTopaz
//
// Created by Andrew Fox on 5/8/18.
//
//
#ifndef TerrainOperationEditPoint_hpp
#define TerrainOperationEditPoint_hpp
#include "TerrainOperation.hpp"
#include "CerealGLM.hpp"
class VoxelData;
// An operation which edits a single voxel block.
// This is useful for edits made with the mouse cursor ala Minecraft.
class TerrainOperationEditPoint : public TerrainOperation
{
public:
// Default destructor.
virtual ~TerrainOperationEditPoint() = default;
// Default constructor
TerrainOperationEditPoint() = default;
// Constructor.
TerrainOperationEditPoint(glm::vec3 location, Voxel newValue);
// Performs the operation.
void perform(VoxelData &voxelData) override;
// Serialize the operation.
template<typename Archive>
void serialize(Archive &archive)
{
archive(cereal::base_class<TerrainOperation>(this),
cereal::make_nvp("location", _location),
cereal::make_nvp("newValue", _newValue));
}
private:
glm::vec3 _location;
Voxel _newValue;
};
CEREAL_REGISTER_TYPE(TerrainOperationEditPoint);
#endif /* TerrainOperationEditPoint_hpp */
| [
"foxostro@gmail.com"
] | foxostro@gmail.com |
898f9b20295f684592c6a130ba665d71bfb56e14 | b49621154ebcd28a10df8e8e5ef90d76d963f8b6 | /Grayscale/OpenCVInterface/OpenCVInterface/Bin2Val.cpp | 2cee15efc6c1493389aa549448a469f1db2b9b59 | [] | no_license | alduleacristi/proiect-procesare-imagini | b8fdfc7720cdb1b2c67871114dfd6ae9affd0bb4 | 980c784c5bd48c5e6d13776048fd37f1bdd34ea3 | refs/heads/master | 2016-08-12T06:47:37.981466 | 2013-12-09T11:02:03 | 2013-12-09T11:02:03 | 44,041,915 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 851 | cpp | // Bin2Val.cpp : implementation file
//
#include "stdafx.h"
#include "OpenCVInterface.h"
#include "Bin2Val.h"
#include "afxdialogex.h"
// Bin2Val dialog
IMPLEMENT_DYNAMIC(Bin2Val, CDialogEx)
Bin2Val::Bin2Val(CWnd* pParent /*=NULL*/)
: CDialogEx(Bin2Val::IDD, pParent)
{
}
Bin2Val::~Bin2Val()
{
}
void Bin2Val::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(Bin2Val, CDialogEx)
ON_BN_CLICKED(IDOK, &Bin2Val::OnBnClickedOk)
END_MESSAGE_MAP()
// Bin2Val message handlers
void Bin2Val::OnBnClickedOk()
{
CString s1,s2;
GetDlgItem(IDC_T1)->GetWindowText(s1);
GetDlgItem(IDC_T2)->GetWindowText(s2);
t1=atoi(s1);
t2=atoi(s2);
CDialogEx::OnOK();
}
int Bin2Val::getT1(void)
{
return t1;
}
int Bin2Val::getT2(void)
{
return t2;
}
| [
"vereseniko11@gmail.com"
] | vereseniko11@gmail.com |
16d6aa24e766c9f6fe27b57b2a892ef5b582344a | 9ee3e1553fe2ad320d73ca7e0c7fb77abfe6aa74 | /MyCppGame/Classes/src/Vibrator.cpp | 151682014feb038c5e82505662ea2b47703b46f7 | [
"MIT"
] | permissive | Crasader/FinalYearProject | be70553a1adfc844d813fe72c328d1c525c30a9b | 359c0cb74f3f246ae0ecb6a2627e02aa3df68aee | refs/heads/master | 2021-05-31T20:02:09.308199 | 2016-04-20T20:38:16 | 2016-04-20T20:38:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 586 | cpp | #include "Vibrator.h"
void Vibrator::Vibrate(int time)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "vibrate", "(I)V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID, time);
t.env->DeleteLocalRef(t.classID);
}
#endif
}
void Vibrator::CancelVibrate()
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "cancelVibrate", "()V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
}
#endif
} | [
"shane.dooley94@gmail.com"
] | shane.dooley94@gmail.com |
c2dbc74835e4e9a8977bdb00ca1c18ca7f85f1c8 | c8a8b1b2739ff50c3565cdc1497e6abf4492b3dd | /src/csapex_core_test/src/processing_test.cpp | f97b4955a74760e139dc1f9e13a516b793905132 | [] | permissive | betwo/csapex | 645eadced88e65d6e78aae4049a2cda5f0d54b4b | dd8e24f14cdeef59bedb8f974ebdc0b0c656ab4c | refs/heads/master | 2022-06-13T06:15:10.306698 | 2022-06-01T08:50:51 | 2022-06-01T09:03:05 | 73,413,991 | 0 | 0 | BSD-3-Clause | 2020-01-02T14:01:01 | 2016-11-10T19:26:29 | C++ | UTF-8 | C++ | false | false | 4,032 | cpp | #include <csapex/model/graph_facade_impl.h>
#include <csapex/model/graph/graph_impl.h>
#include <csapex/model/graph.h>
#include <csapex/model/node_facade_impl.h>
#include <csapex/model/node.h>
#include <csapex/model/node_handle.h>
#include <csapex/model/node_modifier.h>
#include <csapex/model/node_worker.h>
#include <csapex/msg/direct_connection.h>
#include <csapex/msg/generic_value_message.hpp>
#include <csapex/msg/input.h>
#include <csapex/msg/input_transition.h>
#include <csapex/msg/io.h>
#include <csapex/msg/output_transition.h>
#include <csapex/msg/static_output.h>
#include <csapex/utility/uuid_provider.h>
#include <csapex_testing/csapex_test_case.h>
#include <csapex_testing/mockup_nodes.h>
#include <csapex_testing/test_exception_handler.h>
#include <mutex>
#include <condition_variable>
#include <csapex_testing/stepping_test.h>
namespace csapex
{
class ProcessingTest : public NodeConstructingTest
{
};
TEST_F(ProcessingTest, DirectCallToProcess)
{
NodeFacadeImplementationPtr times_4 = factory.makeNode("StaticMultiplier4", UUIDProvider::makeUUID_without_parent("StaticMultiplier4"), graph);
Node& node = *times_4->getNode();
NodeHandle& nh = *times_4->getNodeHandle();
ASSERT_TRUE(node.canProcess());
// set the input message
TokenPtr token_in = msg::createToken(23);
InputPtr input = nh.getInput(UUIDProvider::makeUUID_without_parent("StaticMultiplier4:|:in_0"));
ASSERT_NE(nullptr, input);
input->setToken(token_in);
// no inputs are sent now -> node should multiply the input by 4
ASSERT_TRUE(node.canProcess());
node.process(nh, node);
// commit the messages produced by the node
OutputPtr output = nh.getOutput(UUIDProvider::makeUUID_without_parent("StaticMultiplier4:|:out_0"));
ASSERT_NE(nullptr, output);
output->commitMessages(false);
// view outputs
TokenPtr token_out = output->getToken();
TokenDataConstPtr data_out = token_out->getTokenData();
ASSERT_NE(nullptr, data_out);
auto msg_out = std::dynamic_pointer_cast<connection_types::GenericValueMessage<int> const>(data_out);
ASSERT_NE(nullptr, msg_out);
ASSERT_EQ(23 * 4, msg_out->value);
}
TEST_F(ProcessingTest, CallToProcessViaNodeWorker)
{
NodeFacadeImplementationPtr times_4 = factory.makeNode("StaticMultiplier4", UUIDProvider::makeUUID_without_parent("StaticMultiplier4"), graph);
Node& node = *times_4->getNode();
NodeHandle& nh = *times_4->getNodeHandle();
ASSERT_TRUE(node.canProcess());
ASSERT_FALSE(times_4->isProcessing());
ASSERT_FALSE(times_4->canProcess());
// create a temporary output and connect it to the input
OutputPtr tmp_out = std::make_shared<StaticOutput>(UUIDProvider::makeUUID_without_parent("tmp_out"));
InputPtr input = nh.getInput(UUIDProvider::makeUUID_without_parent("StaticMultiplier4:|:in_0"));
ASSERT_NE(nullptr, input);
ConnectionPtr connection = DirectConnection::connect(tmp_out, input);
// set the input message
msg::publish(tmp_out.get(), 23);
// mark the messages as committed
tmp_out->commitMessages(false);
tmp_out->publish();
ASSERT_TRUE(node.canProcess());
ASSERT_TRUE(times_4->canProcess());
ASSERT_TRUE(nh.getInputTransition()->isEnabled());
ASSERT_TRUE(nh.getOutputTransition()->isEnabled());
// no inputs are sent now -> node should multiply the input by 4
ASSERT_FALSE(times_4->isProcessing());
ASSERT_TRUE(times_4->startProcessingMessages());
// commit the messages produced by the node
OutputPtr output = nh.getOutput(UUIDProvider::makeUUID_without_parent("StaticMultiplier4:|:out_0"));
ASSERT_NE(nullptr, output);
// view outputs
TokenPtr token_out = output->getToken();
TokenDataConstPtr data_out = token_out->getTokenData();
ASSERT_NE(nullptr, data_out);
auto msg_out = std::dynamic_pointer_cast<connection_types::GenericValueMessage<int> const>(data_out);
ASSERT_NE(nullptr, msg_out);
ASSERT_EQ(23 * 4, msg_out->value);
}
} // namespace csapex
| [
"sebastian.buck@uni-tuebingen.de"
] | sebastian.buck@uni-tuebingen.de |
a9fb9d2b18afd8678aa0903cfdd8cb631b883b89 | 5d01a2a16078b78fbb7380a6ee548fc87a80e333 | /MarketDataAdapters/iseprovider/isestdpriceprovider.h | 84623f8762a5e59a0f2ccf83e635314dc14e3feb | [] | no_license | WilliamQf-AI/IVRMstandard | 2fd66ae6e81976d39705614cfab3dbfb4e8553c5 | 761bbdd0343012e7367ea111869bb6a9d8f043c0 | refs/heads/master | 2023-04-04T22:06:48.237586 | 2013-04-17T13:56:40 | 2013-04-17T13:56:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,539 | h | // ISEStdPriceProvider.h : Declaration of the CISEStdPriceProvider
#ifndef __ISESTDPRICEPROVIDER_H_
#define __ISESTDPRICEPROVIDER_H_
#include "resource.h" // main symbols
#include "ISEEvents.h"
#include "ObjectID.h"
/////////////////////////////////////////////////////////////////////////////
// CISEStdPriceProvider
class ATL_NO_VTABLE CISEStdPriceProvider :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CISEStdPriceProvider, &CLSID_ISEPriceProvider>,
public ISupportErrorInfoImpl<&IID_IPriceProvider>,
public IConnectionPointContainerImpl<CISEStdPriceProvider>,
public IDispatchImpl<IPriceProvider, &IID_IPriceProvider, &LIBID_ISEPROVIDERLib>,
public IDispatchImpl<IGroupPrice, &IID_IGroupPrice, &LIBID_ISEPROVIDERLib>,
public IConnectionPointImpl<CISEStdPriceProvider, &DIID__IPriceProviderEvents, CComDynamicUnkArray>,
public CISEPriceBase
{
public:
CISEStdPriceProvider()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_ISESTDPRICEPROVIDER)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CISEStdPriceProvider)
COM_INTERFACE_ENTRY(IPriceProvider)
COM_INTERFACE_ENTRY(IGroupPrice)
COM_INTERFACE_ENTRY2(IDispatch, IGroupPrice)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY(IConnectionPointContainer)
END_COM_MAP()
BEGIN_CONNECTION_POINT_MAP(CISEStdPriceProvider)
CONNECTION_POINT_ENTRY(DIID__IPriceProviderEvents)
END_CONNECTION_POINT_MAP()
public:
void FinalRelease()
{
EgTrace("CISEStdPriceProvider::Release");
Disconnect();
}
// CP
virtual HRESULT OnLastQuote(const CComVariant &varParams, const CComVariant &varResults);
virtual HRESULT OnQuoteUpdate(const CComVariant &varParams, const CComVariant &varResults);
virtual HRESULT OnError(ErrorNumberEnum enumError, _bstr_t bstrDescription,
RequestsTypeEnum enumRequest, const CComVariant &varRequest);
virtual HRESULT OnEvent(const EventNumberEnum EventNumber, _bstr_t Description);
// ISupportsErrorInfo
//STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
// IPriceProvider
public:
STDMETHOD(RequestLastQuote)(QuoteUpdateParams* Params);
STDMETHOD(CancelLastQuote)(VARIANT Params);
STDMETHOD(SubscribeQuote)(QuoteUpdateParams* Params);
STDMETHOD(UnSubscribeQuote)(VARIANT Params);
STDMETHOD(Connect)();
STDMETHOD(Disconnect)();
//IGroupPrice
STDMETHOD(RequestGroup)(QuoteUpdateParams* Params,/*[in]*/ GroupRequestType enTypeGroupRequest);
STDMETHOD(CancelGroup)(VARIANT Params);
};
#endif //__ISESTDPRICEPROVIDER_H_
| [
"chuchev@egartech.com"
] | chuchev@egartech.com |
08100b362395043420f286bc6895f0425652cd2f | f5ffab38ba16c51b3e4d01598d01f4ee17ae93ae | /NinjaGaiden/SwordManAttackRight.cpp | 25d49be6c295fe227559a331c84f6fbe48c8e160 | [] | no_license | thanhgit/NinjaGaiden | b497c8477907193ada397630c5cbe6a08ab91547 | d475c671cddbb80c6c544f2a9c487dedd2d4567a | refs/heads/master | 2021-06-19T11:59:01.074268 | 2021-01-24T01:27:53 | 2021-01-24T01:45:49 | 176,050,004 | 0 | 0 | null | 2021-01-29T20:31:04 | 2019-03-17T03:03:56 | C++ | UTF-8 | C++ | false | false | 304 | cpp | #include"SwordManAttackRight.h"
SwordManAttackRight::SwordManAttackRight(SwordManGraphics* _graphics)
{
this->graphics = _graphics;
}
SwordManAttackRight::~SwordManAttackRight()
{
}
void SwordManAttackRight::update(Box* swordMan) {
this->graphics->actackRight(swordMan->GetX(), swordMan->GetY());
} | [
"thanh29695@gmail.com"
] | thanh29695@gmail.com |
3135aeba2588f0ef4e186b67192bc7ccfc48d935 | 9fb456a0f1cc77d148a9c5334c084c2a65630592 | /Procession/include/ConcurrentQueue.h | f8e940786adb56f610ce5ee32925562edddb6dba | [
"Apache-2.0"
] | permissive | eighteight/CinderEight | 4deba73910eb3e02d2f881da303205159a77f052 | d9dfc6a0ad9a9e6c5b82624971127f0335d91639 | refs/heads/master | 2021-06-19T14:46:18.448625 | 2021-01-16T20:55:22 | 2021-01-16T20:55:22 | 16,152,693 | 6 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,757 | h | /*
Copyright (C) 2010-2012 Paul Houx
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.
Based on the excellent article by Anthony Williams:
http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html
01/15/2015 -- eight_io replaced boost and updated for Cinder glNext branch
*/
#pragma once
#include "cinder/Thread.h"
#include <queue>
namespace ph {
template<typename Data>
class ConcurrentQueue
{
public:
ConcurrentQueue(void){};
~ConcurrentQueue(void){};
void push(Data const& data)
{
std::unique_lock<std::mutex> lock(mMutex);
mQueue.push(data);
lock.unlock();
mCondition.notify_one();
}
bool empty() const
{
std::unique_lock<std::mutex> lock(mMutex);
return mQueue.empty();
}
bool try_pop(Data& popped_value)
{
std::unique_lock<std::mutex> lock(mMutex);
if(mQueue.empty())
{
return false;
}
popped_value=mQueue.front();
mQueue.pop();
return true;
}
void wait_and_pop(Data& popped_value)
{
std::unique_lock<std::mutex> lock(mMutex);
while(mQueue.empty())
{
mCondition.wait(lock);
}
popped_value=mQueue.front();
mQueue.pop();
}
std::size_t size() const { return mQueue.size(); }
private:
std::queue<Data> mQueue;
mutable std::mutex mMutex;
std::condition_variable mCondition;
};
} // namespace ph
| [
"bo-ba@mail.ru"
] | bo-ba@mail.ru |
4fbd36fef826e06b5fe8d1984f744780ec92fec0 | 211bb4bf4a7a1683befd887e421876a95b3eae7e | /studyalg/helper.h | b247f3579988cc87c29b722c8bbbb2dc40c65e78 | [
"BSD-3-Clause"
] | permissive | heyihan/scodes | ee7f90fad4af1fe1f4ef0794de67b3e517e389a5 | 342518b548a723916c9273d8ebc1b345a0467e76 | refs/heads/master | 2021-10-09T20:59:05.279783 | 2021-08-24T07:17:21 | 2021-08-24T07:17:21 | 59,666,962 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,046 | h | #ifndef _STUDY_ALG_H_HELPER_
#define _STUDY_ALG_H_HELPER_
#include <iostream>
#include <ctime>
class ProcessTime
{
public:
ProcessTime()
{
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &lastTime_);
}
int64_t elapsedNs(bool renew = false)
{
timespec now;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &now);
if(renew)
{
lastTime_ = now;
}
return (now.tv_sec-lastTime_.tv_sec)*1e9
+ (now.tv_nsec-lastTime_.tv_nsec);
}
private:
timespec lastTime_;
};
typedef void (*func)();
void runOnce(const std::string & title, func f)
{
f();
}
template<typename T>
std::ostream & operator<<(std::ostream & os, const std::vector<T> & elems)
{
bool first = true;
os << '[';
for(auto &e : elems)
{
if(!first)
{
os << ',';
}
os << e;
first = false;
}
os << ']' << std::endl;
return os;
}
#endif
| [
"heyihan1988@163.com"
] | heyihan1988@163.com |
208d0eb4210fd31427bfca2576203321b9163e6b | d54d424ecd73e0444bc04d7f024db8d7c864a85a | /speedwriter/src/wordchecker.h | 3983a1b9703c9ba0431fd5f1df8f4c70b94189ab | [
"Apache-2.0"
] | permissive | jsoref/Cascades-Samples | 51adc41e4d3b33e8507c629e10c0413c515a6906 | ef941b803756d09cff12db1977687dfc2ea5ff46 | refs/heads/master | 2021-04-15T09:45:37.648754 | 2012-11-28T00:15:13 | 2012-11-29T20:35:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,806 | h | /* Copyright (c) 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _WORDCHECKER_H_
#define _WORDCHECKER_H_
#include <QObject>
// Evaluation of the word check may result in one of the following enumeration states; correct, wrong, newline, and end
enum WordResult
{
WordResult_Correct, WordResult_Wrong, WordResult_NewLine, WordResult_End
};
/**
* WordChecker Description:
*
* This class is to evaluate if the string being sent
* to it corresponds to a given string in the text to be typed.
* In other words, the word (string) passed is valid or invalid
* relative to what should be typed.
*
*/
class WordChecker: public QObject
{
Q_OBJECT
/**
* Property that holds the entire speed text that the player is supposed to type
*/
Q_PROPERTY(QString speedText READ speedText WRITE setSpeedText NOTIFY speedTextChanged)
/**
* Property that reflects the number of correctly entered lines so far by the user
*/
Q_PROPERTY(int line READ line NOTIFY lineChanged)
/**
* Property that holds the number of correctly inputed characters so far by the user
*/
Q_PROPERTY(int nbrOfCharacters READ nbrOfCharacters NOTIFY nbrOfCharactersChanged)
/**
* Property that holds the text of all entered lines entered up to the current line
*/
Q_PROPERTY(QString enteredLines READ enteredLines NOTIFY enteredLinesChanged)
/**
* The part of current line that has been entered correctly.
*/
Q_PROPERTY(QString currentCorrectLine READ currentCorrectLine NOTIFY currentCorrectLineChanged)
public:
/**
* This is our constructor which initializes the member variables.
* @param parent The parent Container, if not specified, 0 is used.
*/
WordChecker(QObject *parent = 0);
~WordChecker();
/**
* This function sets the speedText property.
*
* @param speedText The text that the checker will compare against including end of line characters.
*/
void setSpeedText(QString speedText);
/**
* This function return the entire speed text including end of line characters as a QString.
*
* @return The current speed text
*/
QString speedText();
/**
* This function returns the number of lines correctly entered so far.
*
* @return The number of lines correctly entered so far
*/
int line();
/**
* This function returns the number of correctly entered characters so far.
*
* @return The number of correctly entered characters so far
*/
int nbrOfCharacters();
/**
* This function returns a QString of all the text that has been entered prior to the current line.
*
* @return A QString of all entered text before the current line
*/
QString enteredLines();
/**
* This function returns a string of all the correctly entered text for the current line.
*/
QString currentCorrectLine();
/**
* This function checks the current input towards the actual
* text that should be written (hence forth called the speed text).
*
* @param currentWord The current word entered into the text input field.
* @return The WordResult of checking the text (enum state defined above)
*/
Q_INVOKABLE
WordResult checkWord(const QString currentWord);
signals:
/**
* This signal is emitted when a new speed text has been set
*/
void speedTextChanged(QString speedText);
/**
* This signal is emitted when a line break as reached, the parameter, line, is the number of lines
*/
void lineChanged(int line);
/**
* This signal is emitted when progress has been made on correctly entering text on the current line.
*/
void currentCorrectLineChanged(QString currentCorrectLine);
/**
* This signal is emitted when the correctly entered lines changes (the parameter contains only full lines).
*/
void enteredLinesChanged(QString enteredLines);
/**
* This signal is emitted the number of correctly entered characters have changed.
*/
void nbrOfCharactersChanged(int nbrOfCharacters);
/**
* This signal is emitted when all text has been entered correctly.
*/
void ended();
private:
// State variables
int mSpeedTextLength;
// Property variables
QString mSpeedText;
QString mEnteredLines;
QString mCurrentCorrectLine;
int mLine;
int mNbrOfCharacters;
};
#endif // _WORDCHECKER_H_
| [
"jlarsby@rim.com"
] | jlarsby@rim.com |
9aec42781579f43ddcf17789a5f4046c20d8e43f | f724976070a823e3026de2c85225fcb8001e6c72 | /add_item_dialog.cpp | ea7c0d802aaf118943aaeb4498f76dd8d3c50d03 | [] | no_license | iamOgunyinka/Phoebe | b2d5ee4717373b33cf693e5c2748ab7b61049f79 | 6e091a0d96fa0b5a1c5cfc4f4b83f7993a506be7 | refs/heads/master | 2021-01-21T14:52:27.783413 | 2017-06-25T07:57:36 | 2017-06-25T07:57:36 | 95,345,990 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,446 | cpp | #include "add_item_dialog.hpp"
#include "ui_inventory_action_dialog.h"
#include <QMessageBox>
#include <QSqlQuery>
#include <QSqlError>
#include <QCloseEvent>
#include <QFileDialog>
#include <QBuffer>
#include <QImageWriter>
#include <QDebug>
#include "resources.hpp"
AddItemDialog::AddItemDialog( QWidget *parent) :
QDialog(parent), ui( new Ui::InventoryActionDialog ),
cover_page_used{ false }
{
ui->setupUi( this );
QObject::connect( ui->saveButton, SIGNAL(clicked(bool)), this, SLOT( onSaveButtonClicked()) );
QObject::connect( ui->cancelButton, SIGNAL( clicked(bool)), this, SLOT( close()) );
QObject::connect( ui->uploadButton, SIGNAL(clicked(bool)), this, SLOT(onUploadButtonClicked()) );
setMaximumSize( QSize( 400, 350 ) );
setWindowTitle( tr( "Add New record" ));
ui->dateTimeEdit->setDateTime( QDateTime::currentDateTime() );
}
QString AddItemDialog::TABLE_NAME = "inventory";
AddItemDialog::~AddItemDialog()
{
delete ui;
}
bool AddItemDialog::IsColumnsEmpty()
{
return ( ui->authorLineEdit->text().isEmpty() || ui->titleLineEdit->text().isEmpty() ||
ui->locationLineEdit->text().isEmpty() || ui->stockLineEdit->text().isEmpty() ||
ui->priceLineEdit->text().isEmpty() || ui->publisherLineEdit->text().isEmpty() );
}
void AddItemDialog::onSaveButtonClicked()
{
if( IsColumnsEmpty() )
{
QMessageBox::warning( this, tr("Save"), tr("Please make sure all proper boxes are filled"),
QMessageBox::Ok );
return;
}
bool is_valid_quantity = false, is_valid_price = false;
int const quantity = ui->stockLineEdit->text().toInt( &is_valid_quantity );
if( !is_valid_quantity || quantity <= 0 ){
QMessageBox::warning( this, "Save", tr( "Invalid stock number" ), QMessageBox::Ok );
return;
}
double const price = ui->priceLineEdit->text().toDouble( &is_valid_price );
if( !is_valid_price || price <= 0.0 ){
QMessageBox::warning( this, "Save", tr( "Invalid price used" ) );
return;
}
QString const columns = tr( "date_time, book_title, author_name, publisher, stock, price, location" ) +
( cover_page_used == true ? tr( ", book_cover" ) : tr( "" ) );
QString const values = tr( "'" ) + GetDateTime( ui->dateTimeEdit->dateTime() ) + "', "
+ tr( "'" ) + ui->titleLineEdit->text() + "', '"
+ ui->authorLineEdit->text() + "', '"
+ ui->publisherLineEdit->text() + "', '"
+ ui->stockLineEdit->text() + "', '"
+ ui->priceLineEdit->text() + "', '"
+ ui->locationLineEdit->text() + tr( "'" );
QString const insert_string = tr( "INSERT INTO %1 ( %2 ) VALUES( %4 %3 )")
.arg( TABLE_NAME ).arg( columns )
.arg( cover_page_used == true ? ", :image_data" : "" ).arg( values );
QSqlQuery query{};
query.prepare( insert_string );
if( cover_page_used && !m_cover.isNull() ){
QBuffer buffer {};
QImageWriter image_writer{ &buffer, "PNG" };
image_writer.write( m_cover );
query.bindValue( ":image_data", buffer.data() );
}
if( !query.exec() ){
QMessageBox::warning( this, "Save", query.lastError().text(), QMessageBox::Ok );
} else {
GenerateReport();
if( QMessageBox::information( this, "Save",
tr("Information saved successfully, would you like to add more?" ),
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
{
ClearEntries();
this->accept();
return;
}
ClearEntries();
}
}
void AddItemDialog::ClearEntries()
{
ui->dateTimeEdit->clear();
ui->authorLineEdit->clear();
ui->locationLineEdit->clear();
ui->publisherLineEdit->clear();
ui->stockLineEdit->clear();
ui->priceLineEdit->clear();
ui->titleLineEdit->clear();
ui->titleLineEdit->setFocus();
ui->coverImageLabel->clear();
ui->coverImageLabel->setText( tr( "No Image" ));
m_cover = QImage();
cover_page_used = false;
}
void AddItemDialog::closeEvent( QCloseEvent *event )
{
if( !IsColumnsEmpty() ){
if( QMessageBox::warning( this, "Close", "You have unsaved data, are you sure you wanna close this?",
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes ){
event->accept();
return;
}
event->ignore();
return;
}
event->accept();
}
void AddItemDialog::onUploadButtonClicked()
{
QString filename = QFileDialog::getOpenFileName( this, tr( "Open picture" ), QString(),
tr("PNG Images(*.png)"));
if( !filename.isNull() ){
QImage image{ filename };
if( image.isNull() ){
QMessageBox::warning( this, "Open picture", "Unable to open picture", QMessageBox::Ok );
return;
}
image = image.scaled( 100, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation );
ui->coverImageLabel->clear();
ui->coverImageLabel->setPixmap( QPixmap::fromImage( image ));
ui->coverImageLabel->setMaximumSize( QSize( 100, 100 ));
m_cover = image;
cover_page_used = true;
}
}
void AddItemDialog::GenerateReport()
{
QSqlQuery report_query {};
report_query.prepare( "INSERT INTO reports( book_title, author_name, stock, date_performed, "
"transaction_type, price, total ) VALUES ( :title, :author, "
":stck, :date, :type, :price, :total )");
report_query.bindValue( ":title", ui->titleLineEdit->text() );
report_query.bindValue( ":author", ui->authorLineEdit->text() );
report_query.bindValue( ":stck", ui->stockLineEdit->text().toInt() );
report_query.bindValue( ":date", QDateTime::currentDateTime() );
report_query.bindValue( ":type", static_cast<int> ( ReportActionType::ADDITIONS ) );
report_query.bindValue( ":price", ui->priceLineEdit->text() );
report_query.bindValue( ":total", ui->priceLineEdit->text().toDouble() *
ui->stockLineEdit->text().toInt() );
if( !report_query.exec() ){
qDebug() << report_query.lastError();
QMessageBox::information( this, "Report", "Unable to generate report", QMessageBox::Ok );
return;
}
}
| [
"ogunyinkajoshua@yahoo.com"
] | ogunyinkajoshua@yahoo.com |
25ef5c4717abc862eb68fda04b18ff2754405523 | abf406f991ff41c5714f3f17cf5bdc6584d8cc44 | /Dzwig/Window.h | 6eb7ef12cde056eaff89667b0b28cc1635e29fea | [] | no_license | pszemegw/OpenGL-Dzwig | 579374cd94c174aaba057cf5f8a2432068e2dea1 | 091cc4eb9b1d6d01a5f652182daf2103f3e2bd3e | refs/heads/master | 2023-05-26T10:56:47.084914 | 2021-06-14T09:14:05 | 2021-06-14T09:14:05 | 376,753,960 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,138 | h | #pragma once
#define GLEW_STATIC
#include <GL/glew.h>
#include "ShaderProgram.h"
#include "Skybox.h"
#include "Camera.h"
#include "Cuboid.h"
#include "Crane.h"
#include "Light.h"
#include <GLFW/glfw3.h>
#include <SOIL.h>
#include <iostream>
using namespace std;
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
class Window
{
GLint initStatus = 0;
GLuint width = 800;
GLuint height = 600;
GLdouble deltaTime = 0.f;
GLFWwindow* openglWindow;
ShaderProgram shaderProgram;
Camera* camera;
Skybox* skybox;
Crane* dzwig;
bool lmbPressed = false;
bool rmbPressed = false;
bool isFocused = true;
glm::dvec2 prevMousePos;
Cuboid* cube;
Cuboid* ground;
Light* light;
void drawGround(GLuint vao);
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode);
static void onKey(GLFWwindow* window, int key, int scancode, int actions, int mods)
{
Window* obj = (Window*)glfwGetWindowUserPointer(window);
obj->onKey(key, scancode, actions, mods);
}
static void focus_callback(GLFWwindow* window, int focused)
{
Window* obj = (Window*)glfwGetWindowUserPointer(window);
obj->focus_callback(focused);
}
static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
{
Window* obj = (Window*)glfwGetWindowUserPointer(window);
obj->mouseCallback(xpos, ypos);
}
static void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
Window* obj = (Window*)glfwGetWindowUserPointer(window);
obj->mouseCallback(xoffset, yoffset);
}
static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
{
Window* obj = (Window*)glfwGetWindowUserPointer(window);
obj->mouse_button_callback(button, action, mods);
}
public:
Window(GLuint w = 800, GLuint h = 600);
int mainLoop();
void onKey(int key, int scancode, int actions, int mods);
void mouseCallback(double xpos, double ypos);
void focus_callback(int focused);
void scroll_callback(double xoffset, double yoffset);
void mouse_button_callback(int button, int action, int mods);
void keyboardInput();
}; | [
"pwieczo3@mion.elka.pw.edu.pl"
] | pwieczo3@mion.elka.pw.edu.pl |
b1f8bb22cf5ab0a14c8106abe344437fdac0fda9 | ede874b59555fd65ab2aa44f17a71a5a748eafa6 | /include/etl/std.hpp | 060e1bbe66213f7f0fb2eb3e053e66329d8d9278 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | bechirzf/etl-2 | aad392dc07f42dd772914931ed192829d2d64a74 | 32e8153b38e0029176ca4fe2395b7fa6babe3189 | refs/heads/master | 2020-06-11T10:52:16.362349 | 2018-05-07T08:41:17 | 2018-05-07T08:41:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,061 | hpp | //=======================================================================
// Copyright (c) 2014-2018 Baptiste Wicht
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//=======================================================================
#pragma once
// STL
#include <complex>
#include <vector>
#include <array>
#include <algorithm> //For value_testable
#include <iosfwd> //For stream support
#include <type_traits> //For static assertions tests
#include <tuple> //For TMP stuff
#include <thread>
// cpp_utils
#include "cpp_utils/compat.hpp"
#include "cpp_utils/tmp.hpp"
#include "cpp_utils/likely.hpp"
#include "cpp_utils/assert.hpp"
#include "cpp_utils/parallel.hpp"
// Macro to handle noexcept and cpp_assert
namespace etl {
#ifdef NDEBUG
constexpr bool assert_nothrow = true;
#else
#ifdef CPP_UTILS_ASSERT_EXCEPTION
constexpr bool assert_nothrow = false;
#else
constexpr bool assert_nothrow = true;
#endif
#endif
/*!
* \brief Alignment flag to aligned expressions
*
* This can be used to make expressions more clear.
*/
constexpr bool aligned = false;
/*!
* \brief Alignment flag to unaligned expressions.
*
* This can be used to make expressions more clear.
*/
constexpr bool unaligned = false;
/*!
* \brief The current major version number of the library
*/
constexpr size_t version_major = 1;
/*!
* \brief The current minor version number of the library
*/
constexpr size_t version_minor = 3;
/*!
* \brief The current revision version number of the library
*/
constexpr size_t version_revision = 0;
} //end of namespace etl
/*!
* \brief String representation of the current version of the library.
*/
#define ETL_VERSION_STR "1.3.0"
/*!
* \brief The current major version number of the library
*/
#define ETL_VERSION_MAJOR 1
/*!
* \brief The current minor version number of the library
*/
#define ETL_VERSION_MINOR 3
/*!
* \brief The current revision version number of the library
*/
#define ETL_VERSION_REVISION 0
| [
"baptiste.wicht@gmail.com"
] | baptiste.wicht@gmail.com |
b1ecbf1c286bbbb24b4cece306d9fd8f4314518e | ddd1627528684416cba58a9432ec3036435056a8 | /GFX/GFX/GFXExMan.h | 1429be4c9098416eb10c2ee6da4dc8ccf1a005a5 | [] | no_license | sunhanpt/GFEffect | 70b027b023c455bdafd58a02eb7af4aa6fccc4ce | 79f2194a9899aeb84ce742ab9aff860cefa664db | refs/heads/master | 2021-05-06T02:08:48.533451 | 2017-12-17T03:43:59 | 2017-12-17T03:43:59 | 114,505,475 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 230 | h | #pragma once
/*
** Name: GFXExMan.h
** By: pengtong.pt
** Desc: GFXExµÄ¹ÜÀíÀà
*/
#include <vector>
class GFXEx;
class GFXExMan
{
public:
GFXExMan() {}
virtual ~GFXExMan() {}
public:
std::vector<GFXEx*> m_GFXExArr;
}; | [
"763737898@qq.com"
] | 763737898@qq.com |
df76988999542c74a1821479ecd1f6e590599479 | 15df5a5837fcd8b4dc90d28a470ecbedf104f915 | /Google Kickstart/Increasing Substring.cpp | 492f9ad433800fc33fb924c60d05935d680a921d | [] | no_license | karim19mohamed/Competitive-Programming-Trainning | 888e05551dfd5285811143936360e9d3aee039ad | 27372dd610b57803a79115c4166675fbf1b1c5c2 | refs/heads/master | 2022-05-08T05:33:49.243995 | 2022-04-27T06:25:14 | 2022-04-27T06:25:14 | 244,510,424 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,404 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef complex<double> point;
#define endl '\n'
#define F first
#define S second
#define dbg(x) cerr<<#x<<" = "<<x<<endl
#define dbg2(x,y) cerr<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<endl
#define dbg3(x,y,z) cerr<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<", "<<#z<<" = "<<z<<endl
#define dbg4(x,y,z,q) cerr<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<", "<<#z<<" = "<<z<<", "<<#q<<" = "<<q<<endl
#define FOR(sz) for(int i = 0; i < sz; ++i)
#define dbg_array(x,sz) FOR(sz) cerr << x[i] << " \n"[i==sz-1]
#define X real()
#define Y imag()
const int d4i[4] = { -1, 0, 1, 0 }, d4j[4] = { 0, 1, 0, -1 };
const int d8i[8] = { -1, -1, 0, 1, 1, 1, 0, -1 }, d8j[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };
void _init_() {
ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef ECLIPSE
freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);
#endif
}
const int N = 2e5 + 9, M = 1e8 + 9, SEG = 131072; // SEG = 1 << ((int) ceil(log2(N)) + 1)
const int Mod_M = 1e9 + 7;
void solve() {
int n;
char s[N];
scanf("%d%s", &n, s);
int cnt = 1;
printf("%d", cnt);
for (int i = 1; s[i]; ++i) {
if (s[i] > s[i - 1]) {
++cnt;
} else {
cnt = 1;
}
printf(" %d", cnt);
}
puts("");
}
int main() {
_init_();
int t, cs = 1;
scanf("%d", &t);
while (t--) {
printf("Case #%d: ", cs++);
solve();
}
return 0;
}
| [
"s.karim.ibrahim@gmail.com"
] | s.karim.ibrahim@gmail.com |
4973a1a2810e55f08a439d1f3d027966feb4c8f8 | 85fea1230d5134a7bdf0a20176e9c1764ff5ee10 | /chrome/browser/signin/identity_manager_factory.cc | 741664f3b5bfe0db22fdeae79dab517bf1f38956 | [
"BSD-3-Clause"
] | permissive | jin5866/chromium | 1b28eccdd4ff95ba746eb713dcc262c1ac4d07b5 | 513431963be3a30484235373297c8b5d5e248b5a | refs/heads/master | 2023-03-05T22:13:15.169295 | 2019-02-12T08:12:14 | 2019-02-12T08:12:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,169 | cc | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/signin/identity_manager_factory.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "services/identity/public/cpp/accounts_cookie_mutator.h"
#include "services/identity/public/cpp/accounts_cookie_mutator_impl.h"
#include "services/identity/public/cpp/accounts_mutator.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/identity/public/cpp/primary_account_mutator.h"
#if !defined(OS_CHROMEOS)
#include "services/identity/public/cpp/primary_account_mutator_impl.h"
#endif
#if !defined(OS_ANDROID)
#include "services/identity/public/cpp/accounts_mutator_impl.h"
#endif
namespace {
// Helper function returning a newly constructed PrimaryAccountMutator for
// |profile|. May return null if mutation of the signed-in state is not
// supported on the current platform.
std::unique_ptr<identity::PrimaryAccountMutator> BuildPrimaryAccountMutator(
Profile* profile) {
#if !defined(OS_CHROMEOS)
return std::make_unique<identity::PrimaryAccountMutatorImpl>(
AccountTrackerServiceFactory::GetForProfile(profile),
SigninManagerFactory::GetForProfile(profile));
#else
return nullptr;
#endif
}
// Helper function returning a newly constructed AccountsMutator for
// |profile|. May return null if mutation of accounts is not supported on the
// current platform.
std::unique_ptr<identity::AccountsMutator> BuildAccountsMutator(
Profile* profile) {
#if !defined(OS_ANDROID)
return std::make_unique<identity::AccountsMutatorImpl>(
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
AccountTrackerServiceFactory::GetForProfile(profile),
SigninManagerFactory::GetForProfile(profile));
#else
return nullptr;
#endif
}
} // namespace
// Subclass that wraps IdentityManager in a KeyedService (as IdentityManager is
// a client-side library intended for use by any process, it would be a layering
// violation for IdentityManager itself to have direct knowledge of
// KeyedService).
// NOTE: Do not add any code here that further ties IdentityManager to Profile
// without communicating with {blundell, sdefresne}@chromium.org.
class IdentityManagerWrapper : public KeyedService,
public identity::IdentityManager {
public:
explicit IdentityManagerWrapper(Profile* profile)
: identity::IdentityManager(
SigninManagerFactory::GetForProfile(profile),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
AccountTrackerServiceFactory::GetForProfile(profile),
GaiaCookieManagerServiceFactory::GetForProfile(profile),
BuildPrimaryAccountMutator(profile),
BuildAccountsMutator(profile),
std::make_unique<identity::AccountsCookieMutatorImpl>(
GaiaCookieManagerServiceFactory::GetForProfile(profile))) {}
};
IdentityManagerFactory::IdentityManagerFactory()
: BrowserContextKeyedServiceFactory(
"IdentityManager",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(AccountTrackerServiceFactory::GetInstance());
DependsOn(GaiaCookieManagerServiceFactory::GetInstance());
DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
DependsOn(SigninManagerFactory::GetInstance());
}
IdentityManagerFactory::~IdentityManagerFactory() {}
// static
identity::IdentityManager* IdentityManagerFactory::GetForProfile(
Profile* profile) {
return static_cast<IdentityManagerWrapper*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
// static
identity::IdentityManager* IdentityManagerFactory::GetForProfileIfExists(
const Profile* profile) {
return static_cast<IdentityManagerWrapper*>(
GetInstance()->GetServiceForBrowserContext(const_cast<Profile*>(profile),
false));
}
// static
IdentityManagerFactory* IdentityManagerFactory::GetInstance() {
return base::Singleton<IdentityManagerFactory>::get();
}
// static
std::unique_ptr<KeyedService>
IdentityManagerFactory::BuildAuthenticatedServiceInstanceForTesting(
const std::string& gaia_id,
const std::string& email,
const std::string& refresh_token,
content::BrowserContext* context) {
auto identity_manager = std::make_unique<IdentityManagerWrapper>(
Profile::FromBrowserContext(context));
identity_manager->SetPrimaryAccountSynchronouslyForTests(gaia_id, email,
refresh_token);
return identity_manager;
}
void IdentityManagerFactory::AddObserver(Observer* observer) {
observer_list_.AddObserver(observer);
}
void IdentityManagerFactory::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
KeyedService* IdentityManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
auto identity_manager = std::make_unique<IdentityManagerWrapper>(
Profile::FromBrowserContext(context));
for (Observer& observer : observer_list_)
observer.IdentityManagerCreated(identity_manager.get());
return identity_manager.release();
}
void IdentityManagerFactory::BrowserContextShutdown(
content::BrowserContext* context) {
auto* identity_manager = static_cast<IdentityManagerWrapper*>(
GetServiceForBrowserContext(context, false));
if (identity_manager) {
for (Observer& observer : observer_list_)
observer.IdentityManagerShutdown(identity_manager);
}
BrowserContextKeyedServiceFactory::BrowserContextShutdown(context);
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
fe3539de317afcd3f5674000f0e1e4fd10ccf718 | 6a42841765f2356da99d9844cab8f3f3353eaebf | /WHGames/DG4/GameServer/GameServerManager.h | baf3b43a530774c017cfa2e66591189e126b1563 | [] | no_license | Ivanhan2018/wh6602_zhuque | d904e1d7136ed7db6cd9b46d65ab33797f400a74 | b0e7e574786eac927d109967618ba2a3af5bbee3 | refs/heads/master | 2020-04-05T17:28:14.739789 | 2018-12-24T07:36:47 | 2018-12-24T07:36:47 | 157,062,380 | 2 | 8 | null | null | null | null | GB18030 | C++ | false | false | 1,445 | h | #ifndef GAME_SERVER_MANAGER_HEAD_FILE
#define GAME_SERVER_MANAGER_HEAD_FILE
#pragma once
#include <afxwin.h> // MFC 核心组件和标准组件
#include <afxext.h> // MFC 扩展
#include <string>
using namespace std;
#include "GameServiceExport.h"
//////////////////////////////////////////////////////////////////////////
//游戏服务器管理类
class CGameServiceManager : public IGameServiceManager
{
//变量定义
protected:
tagGameServiceAttrib m_GameServiceAttrib; //服务属性
//函数定义
public:
//构造函数
CGameServiceManager(void);
//析构函数
virtual ~CGameServiceManager(void);
//基础接口
public:
//释放对象
virtual VOID __cdecl Release() { }
//是否有效
virtual bool __cdecl IsValid() { return AfxIsValidAddress(this,sizeof(CGameServiceManager))?true:false; }
//接口查询
virtual void * __cdecl QueryInterface(const IID & Guid, DWORD dwQueryVer);
//接口函数
public:
//创建桌子
virtual void * __cdecl CreateTableFrameSink(const IID & Guid, DWORD dwQueryVer);
//获取属性
virtual void __cdecl GetGameServiceAttrib(tagGameServiceAttrib & GameServiceAttrib);
//修改参数
virtual bool __cdecl RectifyServiceOption(tagGameServiceOption * pGameServiceOption);
//创建机器
virtual VOID * __cdecl CreateAndroidUserItemSink(REFGUID Guid, DWORD dwQueryVer);
};
//////////////////////////////////////////////////////////////////////////
#endif | [
"hanshouqing85@163.com"
] | hanshouqing85@163.com |
f59fed20c3c44cea31d9bcfe7187a2fb64119eb8 | 096464ba416b30ee1238083d0300df2a32cd698d | /BT_tester/rgb_led.cpp | 3228c90217a6290462b5cf2e86db61fcd1b5aee4 | [] | no_license | ManitoSecurity/BTLibrary | 4d50087cd5d3efcfe28c90160ab5d5551cf624d4 | 22916f2a44fa7ac8c20b95f4e18f935f3ba040f9 | refs/heads/master | 2020-12-24T16:50:30.209117 | 2015-04-07T06:28:48 | 2015-04-07T06:28:48 | 26,699,854 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 560 | cpp | // rgb_led.cpp
// implementation of rgb led driver
// Manito Security Solutions
// Brian Gravelle
// March 14 2015
#include "rgb_led.h"
void init_rgb_led() {
pinMode(LED_R, OUTPUT);
pinMode(LED_G, OUTPUT);
pinMode(LED_B, OUTPUT);
}
void turn_on_red() {
analogWrite(LED_R, ON);
analogWrite(LED_G, OFF);
analogWrite(LED_B, OFF);
}
void turn_on_green() {
analogWrite(LED_R, OFF);
analogWrite(LED_G, ON);
analogWrite(LED_B, OFF);
}
void turn_on_blue() {
analogWrite(LED_R, OFF);
analogWrite(LED_G, OFF);
analogWrite(LED_B, ON);
}
| [
"bgravelle@zagmail.gonzaga.edu"
] | bgravelle@zagmail.gonzaga.edu |
edecb5f6f544eb85fbff41479af6539d603a581e | b228f2aff1aa0410ea19ae222fc701c26ddaf8bd | /BendMXDlg.cpp | 3828640f98774da7b13e94ecac5d788d7c0658e9 | [] | no_license | MXControl/BendMX | c3758d86536f612d801015c6f7a24b1a344f7234 | 6c28abe109fc75cc8a9e3ab8312c505caf44c614 | refs/heads/master | 2016-09-10T10:44:53.502079 | 2015-06-16T01:11:23 | 2015-06-16T01:11:23 | 37,500,138 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,532 | cpp | // BendMXDlg.cpp : implementation file
//
#include "stdafx.h"
#include "BendMX.h"
#ifdef __BENDMX__
#include "BendMXDlg.h"
#include "Settings.h"
#include "I18n.h"
#include "Plugin.h"
#include "Logging\Logging.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#pragma comment(lib, "winmm.lib.")
INITTRACE("BendMXDlg");
/////////////////////////////////////////////////////////////////////////////
// CBendMXDlg dialog
#define TIMER_ID_STARTUP 1121
#define TIMER_ID_SEARCH 1122
extern CSettings g_sSettings;
HWND g_hMXWindow;
CStringArray g_strAuto;
CStringArray g_strHistory;
CStringArray g_aRCMSCommands;
CStringArray g_aWinMXCommands;
CStringArray g_aRoseCommands;
CStringArray g_aMXToolsCommands;
CStringArray g_strRooms;
CStringArray g_strOps;
CStringArray g_strHosts;
CStringArray g_strTrusted;
CStringArray g_strFilter;
DWORD g_nMXStartTic = 0;
CString g_strIdent;
extern CString g_strMyName;
extern CString g_strVersion;
CI18n g_i18n;
CArray<CPlugin*, CPlugin*> g_Plugins;
BOOL g_bAway = FALSE;
UINT UWM_SHUTDOWN = ::RegisterWindowMessage("UWM_SHUTDOWN-B5EAC805-7C0E-4C7B-860E-C08465B6ADE5");
UINT UWM_REPAIR = ::RegisterWindowMessage("UWM_REPAIR-B5EAC805-7C0E-4C7B-860E-C08465B6ADE5");
UINT UWM_AWAY = ::RegisterWindowMessage("UWM_AWAY_{1B060DB9-E971-472C-92CF-7EDFDB9BBF64}");
UINT UWM_ADDCHAT = ::RegisterWindowMessage("UWM_ADDCHAT_{1B060DB9-E971-472C-92CF-7EDFDB9BBF64}");
extern UINT UWM_GETOUT;
HINSTANCE g_hUserDll = 0;
CBendMXDlg::CBendMXDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBendMXDlg::IDD, pParent)
{
ENTRY_TRACE("CBendMXDlg::CBendMXDlg()");
//{{AFX_DATA_INIT(CBendMXDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_dwAwayTick = 0;
g_hMXWindow = NULL;
m_bIsHooked = FALSE;
m_bRepair = FALSE;
m_nTick = 0;
EXIT_TRACE("CBendMXDlg::CBendMXDlg()");
g_hUserDll = ::LoadLibrary("USER32.dll");
}
void CBendMXDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBendMXDlg)
DDX_Control(pDX, IDC_PREFBAR, m_lcPrefs);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBendMXDlg, CDialog)
//{{AFX_MSG_MAP(CBendMXDlg)
ON_NOTIFY(NM_CLICK, IDC_PREFBAR, OnClickPrefbar)
ON_BN_CLICKED(IDC_APPLY, OnApply)
ON_WM_DESTROY()
ON_WM_TIMER()
//}}AFX_MSG_MAP
ON_REGISTERED_MESSAGE(UWM_SHUTDOWN, OnShutdown)
ON_REGISTERED_MESSAGE(UWM_REPAIR, OnRepair)
ON_REGISTERED_MESSAGE(UWM_AWAY, OnAway)
ON_REGISTERED_MESSAGE(UWM_ADDCHAT, SearchChatWnd)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBendMXDlg message handlers
BOOL CBendMXDlg::OnInitDialog()
{
ENTRY_TRACE("CBendMXDlg::OnInitDialog()");
CDialog::OnInitDialog();
g_strIdent.Format(" [%X]", m_hWnd);
g_i18n.LoadLanguage(g_sSettings.GetLanguage());
g_i18n.TranslateDialog(this, IDD_BENDMX);
HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 |ILC_MASK , 5, 1);
m_cImageList.Attach(hList);
AfxSetResourceHandle(m_hInstance);
CBitmap cBmp;
cBmp.LoadBitmap(IDB_PREF);
m_cImageList.Add(&cBmp, RGB(255,0, 255));
cBmp.DeleteObject();
m_lcPrefs.Init(FALSE);
m_lcPrefs.SetImageList(&m_cImageList, LVSIL_NORMAL);
m_lcPrefs.SetIconSpacing(48,32);
m_lcPrefs.InsertColumn(0, g_i18n.GetString(IDS_SETTINGS), LVCFMT_LEFT, 34);
m_lcPrefs.InsertItem(0, g_i18n.GetString(IDS_GENERAL),0);
m_lcPrefs.InsertItem(1, g_i18n.GetString(IDS_WELCOMEMSG), 5);
m_lcPrefs.InsertItem(2, g_i18n.GetString(IDS_MSG), 3);
m_lcPrefs.InsertItem(3, g_i18n.GetString(IDS_FILTER), 2);
m_lcPrefs.InsertItem(4, g_i18n.GetString(IDS_BOT), 6);
m_lcPrefs.InsertItem(5, g_i18n.GetString(IDS_USERS), 1);
m_lcPrefs.InsertItem(6, g_i18n.GetString(IDS_ABOUT), 4);
m_lcPrefs.SetCurSel(0);
m_nSel = 0;
// Init Dialogs
LoadRCMS();
CRect rcSheet;
GetDlgItem(IDC_STATIC_CONFIG_RECT)->GetWindowRect(&rcSheet);
ScreenToClient(&rcSheet);
m_pGeneral = new CGeneralDlg;
m_pGeneral->Create(IDD_GENERAL, this);
m_pGeneral->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pGeneral->ShowWindow(SW_SHOW);
m_pWelcome = new CWelcomeMsg;
m_pWelcome->Create(IDD_WELCOMEMSGS, this);
m_pWelcome->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pWelcome->ShowWindow(SW_HIDE);
m_pColors = new CColorDlg;
m_pColors->Create(IDD_COLORS, this);
m_pColors->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pColors->ShowWindow(SW_HIDE);
m_pFilter = new CFilterDlg;
m_pFilter->Create(IDD_FILTER, this);
m_pFilter->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pFilter->ShowWindow(SW_HIDE);
m_pMessages = new CMessageDlg;
m_pMessages->Create(IDD_MESSAGES, this);
m_pMessages->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pMessages->ShowWindow(SW_HIDE);
m_pBot = new CSimpleBot;
m_pBot->Create(IDD_SIMPLEBOT, this);
m_pBot->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pBot->ShowWindow(SW_HIDE);
m_pAbout = new CAboutDlg;
m_pAbout->Create(IDD_ABOUT, this);
m_pAbout->SetWindowPos(NULL, rcSheet.left+5, rcSheet.top+5, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
m_pAbout->ShowWindow(SW_HIDE);
SetTimer(TIMER_ID_STARTUP, 1000, 0);
EXIT_TRACE("CBendMXDlg::OnInitDialog()");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CBendMXDlg::OnSelChanged(int oldItem, int newItem)
{
ENTRY_TRACE("CBendMXDlg::OnSelChanged(%d, %d)", oldItem, newItem);
m_pGeneral->ShowWindow(SW_HIDE);
m_pFilter->ShowWindow(SW_HIDE);
m_pMessages->ShowWindow(SW_HIDE);
m_pAbout->ShowWindow(SW_HIDE);
m_pBot->ShowWindow(SW_HIDE);
m_pColors->ShowWindow(SW_HIDE);
m_pWelcome->ShowWindow(SW_HIDE);
switch(newItem){
case 0:
m_pGeneral->ShowWindow(SW_SHOW);
break;
case 1:
m_pWelcome->ShowWindow(SW_SHOW);
break;
case 2:
m_pMessages->ShowWindow(SW_SHOW);
break;
case 3:
m_pFilter->ShowWindow(SW_SHOW);
break;
case 4:
m_pBot->ShowWindow(SW_SHOW);
break;
case 5:
m_pColors->ShowWindow(SW_SHOW);
break;
case 6:
m_pAbout->ShowWindow(SW_SHOW);
break;
}
m_nSel = newItem;
EXIT_TRACE("CBendMXDlg::OnSelChanged()");
}
void CBendMXDlg::OnClickPrefbar(NMHDR* pNMHDR, LRESULT* pResult)
{
ENTRY_TRACE("CBendMXDlg::OnClickPrefbar()");
int nSel = m_lcPrefs.GetCurSel();
if((nSel != -1) && (nSel != m_nSel)){
OnSelChanged(m_nSel, nSel);
}
*pResult = 0;
LTRACE("Leavinging CBendMXDlg::OnInitDialog()");
}
void CBendMXDlg::OnCancel()
{
ENTRY_TRACE("CBendMXDlg::OnCancel()");
OnApply();
ShowWindow(SW_HIDE);
EXIT_TRACE("CBendMXDlg::OnCancel()");
}
void CBendMXDlg::OnOK()
{
ENTRY_TRACE("CBendMXDlg::OnOK()");
OnApply();
ShowWindow(SW_HIDE);
CDialog::OnOK();
EXIT_TRACE("CBendMXDlg::OnOK()");
}
void CBendMXDlg::OnApply()
{
ENTRY_TRACE("CBendMXDlg::OnApply()");
m_pGeneral->Apply();
m_pFilter->Apply();
m_pMessages->Apply();
m_pBot->Apply();
m_pColors->Apply();
m_pWelcome->Apply();
g_sSettings.Save();
g_sSettings.Load();
EXIT_TRACE("CBendMXDlg::OnApply()");
}
void CBendMXDlg::OnDestroy()
{
ENTRY_TRACE("CBendMXDlg::OnDestroy()");
CDialog::OnDestroy();
if(m_pGeneral != NULL){
LTRACE("Deleting GeneralDlg");
m_pGeneral->UnloadPlugins();
m_pGeneral->ShowWindow(SW_HIDE);
m_pGeneral->DestroyWindow();
delete m_pGeneral;
m_pGeneral = NULL;
}
if(m_pWelcome != NULL){
LTRACE("Deleting WelcomeDlg");
m_pWelcome->ShowWindow(SW_HIDE);
m_pWelcome->DestroyWindow();
delete m_pWelcome;
m_pWelcome = NULL;
}
if(m_pColors != NULL){
LTRACE("Deleting ColorlDlg");
m_pColors->ShowWindow(SW_HIDE);
m_pColors->DestroyWindow();
delete m_pColors;
m_pColors = NULL;
}
if(m_pFilter != NULL){
LTRACE("Deleting FilterDlg");
m_pFilter->ShowWindow(SW_HIDE);
m_pFilter->DestroyWindow();
delete m_pFilter;
m_pFilter = NULL;
}
if(m_pMessages != NULL){
LTRACE("Deleting MessagesDlg");
m_pMessages->ShowWindow(SW_HIDE);
m_pMessages->DestroyWindow();
delete m_pMessages;
m_pMessages = NULL;
}
if(m_pBot != NULL){
LTRACE("Deleting BotDlg");
m_pBot->ShowWindow(SW_HIDE);
m_pBot->DestroyWindow();
delete m_pBot;
m_pBot = NULL;
}
if(m_pAbout != NULL){
LTRACE("Deleting AboutDlg");
m_pAbout->ShowWindow(SW_HIDE);
m_pAbout->DestroyWindow();
delete m_pAbout;
m_pAbout = NULL;
}
EXIT_TRACE("CBendMXDlg::OnDestroy()");
}
void CBendMXDlg::OnTimer(UINT nIDEvent)
{
ENTRY_TRACE("CBendMXDlg::SearchProc()");
if(nIDEvent == TIMER_ID_SEARCH){
//EnumChildWindows(g_hMXWindow, FindChatWindows, (LPARAM)this);
m_bRepair = FALSE;
for(int i = 0; i < m_aDlgs.GetSize(); i++){
if(!m_aDlgs[i]->m_bIsHooked){
CChatDlg* pDlg = m_aDlgs[i];
m_aDlgs.RemoveAt(i, 1);
m_aDlgMap.RemoveKey(pDlg->m_strTitle);
pDlg->ShowWindow(SW_HIDE);
pDlg->DestroyWindow();
delete pDlg;
pDlg = NULL;
}
}
}
if(nIDEvent == TIMER_ID_STARTUP){
KillTimer(TIMER_ID_STARTUP);
EnumWindows(EnumWindowsProc, (LPARAM)this);
if(g_hMXWindow != NULL){
LTRACE("Found WinMX Window at %X", g_hMXWindow);
if(!SubclassWinMX(g_hMXWindow)){
LTRACE("Failed to hook into WinMX window");
AfxMessageBox(g_i18n.GetString(IDS_SUBCLASS_FAILED), MB_ICONSTOP+MB_OK);
}
else{
LTRACE("Successfully hooked into WinMX window");
m_bIsHooked = TRUE;
m_pGeneral->LoadPlugins();
if(g_sSettings.GetSoundFX()){
PlaySound(g_sSettings.GetWorkingDir() + "\\data\\startup.dat", 0, SND_ASYNC|SND_FILENAME);
}
}
SetTimer(TIMER_ID_SEARCH, g_sSettings.GetTimerRes(), 0);
}
}
EXIT_TRACE("CBendMXDlg::SearchProc()");
CDialog::OnTimer(nIDEvent);
}
//#define _DEBUG_SPECIAL
BOOL CALLBACK CBendMXDlg::EnumWindowsProc(HWND hWnd, LPARAM lParam)
{
ENTRY_TRACE("CBendMXDlg::EnumWindowsProc(hwnd=%X, lParam=%X)", hWnd, lParam);
BOOL bReturn = TRUE;
char *buffer = new char[400];
::GetWindowText(hWnd, buffer, 400);
#ifndef _DEBUG_SPECIAL
if((strstr(buffer, "WinMX 3.3") != NULL) || (strstr(buffer, "WinMX v3.31") != NULL)){
AfxMessageBox("BendMX detected that you are running WinMX 3.3x!\nThis version of BendMX is designed for WinMX 3.53 and later and will not work with this version of WinMX!\n", MB_ICONSTOP);
}
else if(strstr(buffer, "WinMX v3.5") != NULL){
#else
if(strstr(buffer, "WinMX 3.3") != NULL){
#endif
g_hMXWindow = hWnd;
bReturn = FALSE;
g_strVersion = buffer;
int n = g_strVersion.Find(" <", 0);
if(n > 0){
g_strVersion = g_strVersion.Left(n);
}
else if(g_strVersion.IsEmpty()){
g_strVersion = "WinMX";
}
}
delete buffer;
buffer = NULL;
EXIT_TRACE("CBendMXDlg::EnumWindowsProc() return %d", bReturn);
return bReturn;
}
BOOL CBendMXDlg::SubclassWinMX(HWND hWnd)
{
ENTRY_TRACE("CBendMXDlg::SubclassWinMX(%X)", hWnd);
WNDPROC OldWndProc = (WNDPROC)::SetWindowLong(hWnd, GWL_WNDPROC, (LONG)SubWinMXProc);
if(OldWndProc && (LONG)OldWndProc != (LONG)SubWinMXProc){
::SetWindowLong(hWnd, GWL_USERDATA, (LONG)OldWndProc);
EXIT_TRACE("CBendMXDlg::SubclassWinMX() return 1");
return TRUE;
}
else{
EXIT_TRACE("CBendMXDlg::SubclassWinMX() return 0");
return FALSE;
}
}
LRESULT CALLBACK CBendMXDlg::SubWinMXProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC OldWndProc = (WNDPROC)::GetWindowLong(hwnd, GWL_USERDATA);
if(!OldWndProc) return FALSE;
// Intercept command messages sent from
if(uMsg == WM_COMMAND){
ENTRY_TRACE("CBendMXDlg::SubWinMXProc(WM_COMMAND, wParam=%X, lParam=%X)", wParam, lParam);
// Call BendMX Settings
if(wParam == 10000){
HWND hWnd = ::FindWindow(NULL, g_i18n.GetString(IDD_BENDMX));
if(hWnd != NULL){
::ShowWindow(hWnd, SW_SHOW);
}
}
// Call WinMX settings
else if(wParam == 10001){
return ::CallWindowProc(OldWndProc, hwnd, WM_LBUTTONDOWN, 1, 655950);
}
else if((wParam >= 12000) && (wParam <= 90000)){
for(int i = 0; i < g_Plugins.GetSize(); i++){
g_Plugins[i]->OnMenuCommand(wParam, 0, 0);
}
}
EXIT_TRACE("CBendMXDlg::SubWinMXProc()");
}
else if((uMsg == WM_LBUTTONDOWN)) {
ENTRY_TRACE("CBendMXDlg::SubWinMXProc(WM_LBUTTONDOWN, wParam=%X, lParam=%X)", wParam, lParam);
int x = LOWORD(lParam);
int y = HIWORD(lParam);
if((y >= 3) && (y <= 21) && (x >= 557) && (x <=618)){
CMenu *popup = new CMenu;
BOOL bReturn = TRUE;
if(popup->CreatePopupMenu()){
popup->AppendMenu(MF_STRING|MF_DISABLED, 0, g_i18n.GetString(IDS_CFG_MENU));
popup->AppendMenu(MF_SEPARATOR, 0, " ");
popup->AppendMenu(MF_STRING, 10000, g_i18n.GetString(IDS_BENDMX_CONFIG));
popup->AppendMenu(MF_STRING, 10001, g_i18n.GetString(IDS_CFG_WINMX));
popup->AppendMenu(MF_SEPARATOR, 0, " ");
int nPluginMenuCount = 0;
for(int i = 0; i < g_Plugins.GetSize(); i++){
g_Plugins[i]->m_pPlugin->OnPrepareMenu(1);
if(g_Plugins[i]->m_pPlugin->hCfgMenu <= 0) continue;
popup->AppendMenu(MF_POPUP, (UINT)g_Plugins[i]->m_pPlugin->hCfgMenu, g_Plugins[i]->m_strShortName);
nPluginMenuCount ++;
}
POINT curPos;
curPos.x = 618;
curPos.y = 24;
::ClientToScreen(hwnd, &curPos);
popup->TrackPopupMenu(TPM_RIGHTALIGN | TPM_RIGHTBUTTON | TPM_LEFTBUTTON, curPos.x, curPos.y, CWnd::FromHandle(hwnd), NULL);
popup->DestroyMenu();
}
delete popup;
popup = NULL;
EXIT_TRACE("CBendMXDlg::SubWinMXProc()");
return TRUE;
}
}
else if(uMsg == WM_DESTROY){
HWND hWnd = ::FindWindow(NULL, g_i18n.GetString(IDD_BENDMX));
::SendMessage(hWnd, UWM_SHUTDOWN, 0, 0);
}
return ::CallWindowProc(OldWndProc, hwnd, uMsg, wParam, lParam);
}
BOOL CALLBACK CBendMXDlg::FindChatWindows(HWND hWnd, LPARAM lParam)
{
BOOL bReturn = TRUE;
char *buffer = new char[1000];
::GetWindowText(hWnd, buffer, 1000);
//if(strstr(buffer, " on WinMX Peer Network") && (strlen(buffer) <= 75)){
if(strstr(buffer, (LPCTSTR)((CBendMXDlg*)lParam)->m_strSearch) && (strlen(buffer) <= 75)){
((CBendMXDlg*)lParam)->AddChat(buffer, hWnd);
}
delete buffer;
buffer = NULL;
return bReturn;
}
void CBendMXDlg::AddChat(LPCSTR strChat, HWND hWnd)
{
ENTRY_TRACE("CBendMXDlg::AddChat(strChat=%s, hWnd=%X)", strChat, hWnd);
CString strTitle = strChat;
for(int i = 0; i < m_aDlgs.GetSize(); i++){
if(m_aDlgs[i]->m_strTitle == strTitle){
EXIT_TRACE("CBendMXDlg::AddChat() This window is already hooked");
return;
}
}
CChatDlg *pDlg = new CChatDlg();
pDlg->m_dwID = (DWORD)hWnd;
pDlg->m_strTitle = strTitle;
pDlg->m_hMX = g_hMXWindow;
pDlg->m_bRepair = m_bRepair;
pDlg->Create(IDD_CHATDLG, this);
pDlg->SetWindowText(strTitle + g_strIdent);
#ifdef _DEBUG_SPECIAL
pDlg->ShowWindow(SW_SHOW);
#else
pDlg->ShowWindow(SW_HIDE);
#endif
m_aDlgs.Add(pDlg);
CString strRoom = strTitle;
strRoom.Replace(" on WinMX Peer Network", "");
m_aDlgMap.SetAt(strRoom, pDlg->m_hWnd);
for(i = 0; i < g_Plugins.GetSize(); i++){
g_Plugins[i]->OnEnterChannel(pDlg->m_dwID, strTitle);
}
EXIT_TRACE("CBendMXDlg::AddChat()");
}
void CBendMXDlg::RemoveHook(CString strChat)
{
ENTRY_TRACE("CBendMXDlg::RemoveHook(strChat=%s)", strChat);
for(int i = 0; i < m_aDlgs.GetSize(); i++){
if(m_aDlgs[i]->m_strTitle+g_strIdent == strChat){
for(int j = 0; j < g_Plugins.GetSize(); j++){
g_Plugins[j]->OnCloseChannel(m_aDlgs[i]->m_dwID);
}
m_aDlgs[i]->RemoveHook();
return;
}
}
EXIT_TRACE("CBendMXDlg::RemoveHook()");
}
LRESULT CBendMXDlg::OnRepair(WPARAM wParam, LPARAM lParam)
{
if(AfxMessageBox(g_i18n.GetString(IDS_REPAIRHOOK), MB_ICONQUESTION+MB_YESNO) == IDYES){
//KillTimer(TIMER_ID_SEARCH);
Exit();
m_bRepair = TRUE;
SetTimer(TIMER_ID_STARTUP, 1000, 0);
}
return 1;
}
void CBendMXDlg::Exit()
{
ENTRY_TRACE("CBendMXDlg::Exit()");
m_pGeneral->UnloadPlugins();
while(m_aDlgs.GetSize() > 0){
CChatDlg* pDlg = m_aDlgs[m_aDlgs.GetSize()-1];
m_aDlgs.RemoveAt(m_aDlgs.GetSize()-1, 1);
pDlg->ShowWindow(SW_HIDE);
pDlg->DestroyWindow();
m_aDlgMap.RemoveKey(pDlg->m_strTitle);
delete pDlg;
pDlg = NULL;
}
if(m_bIsHooked){
WNDPROC OldWndProc = (WNDPROC)::GetWindowLong(g_hMXWindow, GWL_USERDATA);
::SetWindowLong(g_hMXWindow, GWL_WNDPROC, (LONG)OldWndProc);
m_bIsHooked = FALSE;
}
EXIT_TRACE("CBendMXDlg::Exit()");
}
void CBendMXDlg::InputMessage(CString strMessage, CString strChat, BOOL bEnter)
{
ENTRY_TRACE("CBendMXDlg::InputMessage()");
if(strChat.IsEmpty()){
for(int i = 0; i < m_aDlgs.GetSize(); i++){
m_aDlgs[i]->InputMessage(strMessage, bEnter);
}
}
else{
for(int i = 0; i < m_aDlgs.GetSize(); i++){
if(m_aDlgs[i]->m_strTitle == strChat){
m_aDlgs[i]->InputMessage(strMessage, bEnter);
EXIT_TRACE("CBendMXDlg::InputMessage()");
return;
}
}
}
EXIT_TRACE("CBendMXDlg::InputMessage() Second Exit");
}
void CBendMXDlg::InputMessage(CString strMessage, DWORD dwID)
{
ENTRY_TRACE("CBendMXDlg::InputMessage(dwID=%X)", dwID);
for(int i = 0; i < m_aDlgs.GetSize(); i++){
if(m_aDlgs[i]->m_dwID == dwID){
m_aDlgs[i]->InputMessage(strMessage);
return;
}
}
EXIT_TRACE("CBendMXDlg::InputMessage()");
}
LRESULT CBendMXDlg::OnShutdown(WPARAM wParam, LPARAM lParam)
{
//::KillTimer(m_hWnd, TIMER_ID_SEARCH);
Exit();
return 1;
}
LRESULT CBendMXDlg::OnAway(WPARAM wParam, LPARAM lParam)
{
ENTRY_TRACE("CBendMXDlg::OnAway(wParam=X, lParam=%X)", wParam, lParam);
int nAction = (int)wParam;
int nReason = (int)lParam;
if(nAction != 2){ // Set Back
DWORD dwAway = GetTickCount() - m_dwAwayTick;
m_dwAwayTick = 0;
int nSec = dwAway / 1000;
int nMin = dwAway / 60000;
int nHour = dwAway / 3600000;
CString strMsg, strTmp;
strTmp.Format("%02d h %02d m %02d s", nHour, nMin - nHour*60, nSec - nMin*60);
if(nAction){
strMsg.Format(g_i18n.GetString(IDS_BACKSILENT), m_strAway, strTmp);
}
else{
strMsg.Format( g_i18n.GetString(IDS_BACK), m_strAway, g_strMyName, strTmp);
}
;
g_bAway = FALSE;
for(int i = 0; i < m_aDlgs.GetSize(); i++){
m_aDlgs[i]->InputMessage(strMsg, TRUE);
}
}
else{ // Set away
m_dwAwayTick = GetTickCount();
g_bAway = TRUE;
switch(nReason){
case 0:
m_strAway = g_i18n.GetString(IDS_ZZZZZZZZ);
break;
case 1:
m_strAway = g_i18n.GetString(IDS_WORK);
break;
case 2:
m_strAway = g_i18n.GetString(IDS_SLEEP);
break;
case 3:
m_strAway = g_i18n.GetString(IDS_AIR);
break;
case 4:
m_strAway = g_i18n.GetString(IDS_BATHROOM);
break;
case 5:
m_strAway = g_i18n.GetString(IDS_SMOKE);
break;
case 6:
m_strAway = g_i18n.GetString(IDS_FOOD);
break;
case 7:
m_strAway = g_i18n.GetString(IDS_BEER);
break;
case 8:
m_strAway = g_i18n.GetString(IDS_TV);
break;
case 9:
m_strAway = g_i18n.GetString(IDS_STORE);
break;
case 10:
m_strAway = g_i18n.GetString(IDS_NONE);
break;
case 11:
char buffer[300];
HWND hTmp = ::FindWindow(NULL, g_i18n.GetString(IDD_UTIL));
::SendMessage(hTmp, UWM_GETOUT, 0, (LPARAM)(char*)&buffer);
m_strAway = buffer;
break;
}
CString strMsg;
strMsg.Format(g_i18n.GetString(IDS_GOINGAWAY), m_strAway);
for(int i = 0; i < m_aDlgs.GetSize(); i++){
m_aDlgs[i]->InputMessage(strMsg, TRUE);
}
}
EXIT_TRACE("CBendMXDlg::OnAway()");
return 1;
}
BOOL CBendMXDlg::DoesRoomExist(const CString strRoom)
{
ENTRY_TRACE("CBendMXDlg::DoesRoomExist()");
BOOL bReturn = FALSE;
for(int i = 0; i < m_aDlgs.GetSize(); i++){
if(m_aDlgs[i]->m_strTitle == strRoom){
bReturn = TRUE;
break;
}
}
EXIT_TRACE("CBendMXDlg::OnAway() return %d", bReturn);
return bReturn;
}
void CBendMXDlg::LoadRCMS()
{
ENTRY_TRACE("CBendMXDlg::LoadRCMS()");
CString strIniFile = g_sSettings.GetWorkingDir() + "\\commands.dat";
CStdioFile ini;
CString strBuffer;
g_aRCMSCommands.RemoveAll();
g_aWinMXCommands.RemoveAll();
g_aRoseCommands.RemoveAll();
g_aMXToolsCommands.RemoveAll();
WORD wMode = -1; // 0 = RCMS, 1 = WinMX, 2 = RoboMX, 3 = MXTools
TRY{
ini.Open(strIniFile, CFile::modeCreate|CFile::modeNoTruncate|CFile::modeRead|CFile::typeText|CFile::shareExclusive);
while(ini.ReadString(strBuffer)){
if(strBuffer.IsEmpty()) continue;
if(strBuffer.Find("[RCMS]", 0) == 0){
wMode = 0;
continue;
}
if(strBuffer.Find("[WINMX]", 0) == 0){
wMode = 1;
continue;
}
if(strBuffer.Find("[MXTOOLS]", 0) == 0){
wMode = 2;
continue;
}
if(strBuffer.Find("[ROSE]", 0) == 0){
wMode = 3;
continue;
}
if(strBuffer.Find("[ROBOMX]", 0) == 0){
wMode = 4;
continue;
}
switch(wMode){
case 0:
g_aRCMSCommands.Add(strBuffer);
break;
case 1:
g_aWinMXCommands.Add(strBuffer);
break;
case 2:
g_aMXToolsCommands.Add(strBuffer);
break;
case 3:
g_aRoseCommands.Add(strBuffer);
default:
// ignore;
break;
}
}
ini.Close();
}
CATCH(CFileException, e){
AfxMessageBox("Error reading commands.dat", MB_OK+MB_ICONSTOP);
}END_CATCH;
EXIT_TRACE("CBendMXDlg::LoadRCMS()");
}
UINT CBendMXDlg::WorkerThread(LPVOID pParam)
{
return 0;
}
LRESULT CBendMXDlg::SearchChatWnd(WPARAM wParam, LPARAM lParam)
{
CString strChat = (LPCTSTR)lParam;
m_strSearch = strChat + " on WinMX Peer Network";
EnumChildWindows(g_hMXWindow, FindChatWindows, (LPARAM)this);
m_strSearch.Empty();
return 1;
}
#endif // #ifdef __BENDMX__
| [
"mxcontrol@mxcontrol.org"
] | mxcontrol@mxcontrol.org |
e0b80e948af24c2ad8f03a56dc25de7c69139526 | 184bcf7925e6718b3021946581576f8cae80526b | /Useless/Class/1.cpp | 8809a021dc0c5ee4db9ce218316b92135027e38b | [] | no_license | iPhreetom/ACM | a99be74de61df37c427ffb685b375febad74ed9a | f3e639172be326846fe1f70437dcf98c90241aa0 | refs/heads/master | 2021-06-14T08:11:24.003465 | 2019-09-13T22:54:34 | 2019-09-13T22:54:34 | 142,748,718 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,458 | cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 200;
vector<int> mp[maxn];
vector<int> ans;
int matrix[maxn][maxn];
bool vis[maxn];
int deep[maxn];
void push(int u, int v) {
matrix[u][v] = 1;
matrix[v][u] = 1;
mp[u].push_back(v);
mp[v].push_back(u);
}
void dfs(int root) {
stack<int> st;
memset(vis,0,sizeof(vis));
ans.clear();
st.push(root);
vis[root] = 1;
while (!st.empty()) {
int p = st.top();
st.pop();
ans.push_back(p);
for (int i=0; i<mp[p].size(); i++) {
int v = mp[p][i];
if (!vis[v]) {
vis[v] = 1;
st.push(v);
}
}
}
for (int i=0; i<ans.size(); i++) {
cout << ans[i] << ' ';
}
cout << endl;
}
void bfs(int root) {
queue<int> que;
memset(vis,0,sizeof(vis));
memset(deep,0,sizeof(deep));
ans.clear();
que.push(root);
vis[root] = 1;
deep[root] = 1;
while(!que.empty()) {
int p = que.front();
que.pop();
ans.push_back(p);
for (int i=0; i<mp[p].size(); i++) {
int v = mp[p][i];
if (!vis[v]) {
que.push(v);
deep[v] = deep[p] + 1;
vis[v] = 1;
}
}
}
for (int i=0; i<ans.size(); i++) {
cout << ans[i] << ' ';
}
cout << endl;
}
int main () {
int m;
cout << "input the number of edge : " << endl;
cin >> m;
cout << "Input two point of the edge: " << endl;
for (int i=1; i<=m; i++) {
int u,v;
cin >> u >> v;
push(u,v);
}
cout << "dfs(1) will get: ";
dfs(1);
cout << endl;
cout << "bfs(1) will get: ";
bfs(1);
return 0;
}
| [
"34025769+iPhreetom@users.noreply.github.com"
] | 34025769+iPhreetom@users.noreply.github.com |
1f41a9cfd543eec0dd47dc5ee5c1f05d5129ea8e | 5f6e8c8ae4188be0d577abb52960b7430ef44a0c | /PHP-scripts/dev-kit/SeaBreeze/src/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnabledQuery.cpp | 88ef80cff3645aaf5680459d4744a968aa5e2406 | [] | no_license | lennon101/Spectrometer-Interface | a71d74c8e248f880a828bc2c137e3ae72c977738 | d295ef431c164a3c4062a93e293197631c9e01ea | refs/heads/master | 2020-05-21T23:59:42.983381 | 2016-10-14T11:31:31 | 2016-10-14T11:31:31 | 62,698,233 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,622 | cpp | /***************************************************//**
* @file OBPLightSourceEnabledQuery.cpp
* @date April 2013
* @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/protocols/obp/exchanges/OBPLightSourceEnabledQuery.h"
#include "vendors/OceanOptics/protocols/obp/hints/OBPControlHint.h"
#include "vendors/OceanOptics/protocols/obp/constants/OBPMessageTypes.h"
#include <vector>
using namespace seabreeze;
using namespace seabreeze::oceanBinaryProtocol;
using namespace std;
OBPLightSourceEnabledQuery::OBPLightSourceEnabledQuery(int module, int source) {
this->hints->push_back(new OBPControlHint());
this->messageType = OBPMessageTypes::OBP_GET_LIGHT_SOURCE_ENABLE;
this->payload.resize(2);
this->moduleIndex = module;
this->lightSourceIndex = source;
}
OBPLightSourceEnabledQuery::~OBPLightSourceEnabledQuery() {
}
bool OBPLightSourceEnabledQuery::queryEnable(TransferHelper *helper)
throw (ProtocolException) {
bool retval;
vector<byte> *result;
this->payload[0] = (byte)this->moduleIndex;
this->payload[1] = (byte)this->lightSourceIndex;
result = this->queryDevice(helper);
if(NULL == result || result->size() < 1) {
throw ProtocolException("Got back no data when trying to get enable status");
}
retval = (*result)[0] == 0 ? false : true;
delete result;
return retval;
} | [
"dane.lennon101@gmail.com"
] | dane.lennon101@gmail.com |
52a798b848f9b680c6fc456434fa09ce9fdcc367 | adb77362c8d663977eee5f09c9034fee4cad42fd | /产生rpc_stubs和common_api头文件的命令/rpc_stubs/CommonApiRpcServer.cpp | 698f20dd91f6c7db33349f4e4873fefddf7d13e2 | [] | no_license | hang2287/Ti-Value | ceff04bbf59beba9a6f5c79c2b1057e4f424dd6b | 2f0fbe8d1e728391d1f7e4ff99007b0640c65cbe | refs/heads/master | 2021-07-04T13:36:53.929762 | 2017-09-27T02:33:50 | 2017-09-27T02:33:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 755,229 | cpp | // _ _ __ _ _
// | | | | / _(_) |
// __ _ ___ _ __ ___ _ __ __ _| |_ ___ __| | | |_ _| | ___
// / _` |/ _ \ '_ \ / _ \ '__/ _` | __/ _ \/ _` | | _| | |/ _ \`
// | (_| | __/ | | | __/ | | (_| | || __/ (_| | | | | | | __/
// \__, |\___|_| |_|\___|_| \__,_|\__\___|\__,_| |_| |_|_|\___|
// __/ |
// |___/
//
//
// Warning: this is a generated file, any changes made here will be
// overwritten by the build process. If you need to change what is
// generated here, you should either modify the input json files
// (network_api.json, wallet_api.json, etc) or modify the code
// generator (tiv_api_generator.cpp) itself
//
#define DEFAULT_LOGGER "rpc"
#include <rpc_stubs/CommonApiRpcServer.hpp>
#include <api/ApiMetadata.hpp>
#include <api/ConversionFunctions.hpp>
#include <boost/bind.hpp>
#include <api/ApiMetadata.hpp>
#include <blockchain/AccountEntry.hpp>
#include <blockchain/Address.hpp>
#include <blockchain/AssetEntry.hpp>
#include <blockchain/Block.hpp>
#include <blockchain/BlockEntry.hpp>
#include <blockchain/ChainDatabase.hpp>
#include <blockchain/FileStoreEntry.hpp>
#include <blockchain/Operations.hpp>
#include <blockchain/PtsAddress.hpp>
#include <blockchain/Transaction.hpp>
#include <blockchain/Types.hpp>
#include <fc/crypto/elliptic.hpp>
#include <fc/crypto/sha256.hpp>
#include <fc/exception/exception.hpp>
#include <fc/filesystem.hpp>
#include <fc/network/ip.hpp>
#include <fc/optional.hpp>
#include <fc/time.hpp>
#include <net/Node.hpp>
#include <stdint.h>
#include <string>
#include <wallet/Pretty.hpp>
#include <wallet/TransactionBuilder.hpp>
#include <wallet/Wallet.hpp>
#include <wallet/WalletEntrys.hpp>
namespace TiValue {
namespace rpc_stubs {
fc::variant CommonApiRpcServer::blockchain_get_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
fc::variant_object result = get_client()->blockchain_get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
fc::variant_object result = get_client()->blockchain_get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_generate_snapshot_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (filename)");
std::string filename = parameters[0].as<std::string>();
get_client()->blockchain_generate_snapshot(filename);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_generate_snapshot_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'filename'");
std::string filename = parameters["filename"].as<std::string>();
get_client()->blockchain_generate_snapshot(filename);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_get_alp_account_balance_entry_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (block_num)");
uint32_t block_num = parameters[0].as<uint32_t>();
std::vector<TiValue::blockchain::AlpTrxidBalance> result = get_client()->blockchain_get_alp_account_balance_entry(block_num);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_alp_account_balance_entry_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("block_num"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'block_num'");
uint32_t block_num = parameters["block_num"].as<uint32_t>();
std::vector<TiValue::blockchain::AlpTrxidBalance> result = get_client()->blockchain_get_alp_account_balance_entry(block_num);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_generate_issuance_map_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (symbol)");
std::string symbol = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (filename)");
std::string filename = parameters[1].as<std::string>();
get_client()->blockchain_generate_issuance_map(symbol, filename);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_generate_issuance_map_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'symbol'");
std::string symbol = parameters["symbol"].as<std::string>();
if (!parameters.contains("filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'filename'");
std::string filename = parameters["filename"].as<std::string>();
get_client()->blockchain_generate_issuance_map(symbol, filename);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_calculate_supply_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (asset)");
std::string asset = parameters[0].as<std::string>();
TiValue::blockchain::Asset result = get_client()->blockchain_calculate_supply(asset);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_calculate_supply_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("asset"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset'");
std::string asset = parameters["asset"].as<std::string>();
TiValue::blockchain::Asset result = get_client()->blockchain_calculate_supply(asset);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_is_synced_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
bool result = get_client()->blockchain_is_synced();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_is_synced_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
bool result = get_client()->blockchain_is_synced();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_count_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
uint32_t result = get_client()->blockchain_get_block_count();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_count_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
uint32_t result = get_client()->blockchain_get_block_count();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_security_state_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
TiValue::blockchain::BlockchainSecurityState result = get_client()->blockchain_get_security_state();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_security_state_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
TiValue::blockchain::BlockchainSecurityState result = get_client()->blockchain_get_security_state();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::string first_account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
uint32_t limit = (parameters.size() <= 1) ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_accounts(first_account_name, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::string first_account_name = parameters.contains("first_account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["first_account_name"].as<std::string>();
uint32_t limit = parameters.contains("limit") ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters["limit"].as<uint32_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_accounts(first_account_name, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_recently_updated_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_recently_updated_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_recently_updated_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_recently_updated_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_recently_registered_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_recently_registered_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_recently_registered_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_recently_registered_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_assets_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::string first_symbol = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
uint32_t limit = (parameters.size() <= 1) ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::vector<TiValue::blockchain::AssetEntry> result = get_client()->blockchain_list_assets(first_symbol, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_assets_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::string first_symbol = parameters.contains("first_symbol") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["first_symbol"].as<std::string>();
uint32_t limit = parameters.contains("limit") ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters["limit"].as<uint32_t>();
std::vector<TiValue::blockchain::AssetEntry> result = get_client()->blockchain_list_assets(first_symbol, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_pending_transactions_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::vector<std::pair<TiValue::blockchain::TransactionIdType, TiValue::blockchain::SignedTransaction>> result = get_client()->blockchain_list_pending_transactions();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_pending_transactions_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::vector<std::pair<TiValue::blockchain::TransactionIdType, TiValue::blockchain::SignedTransaction>> result = get_client()->blockchain_list_pending_transactions();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id_prefix)");
std::string transaction_id_prefix = parameters[0].as<std::string>();
bool exact = (parameters.size() <= 1) ?
(fc::json::from_string("false").as<bool>()) :
parameters[1].as<bool>();
std::pair<TiValue::blockchain::TransactionIdType, TiValue::blockchain::TransactionEntry> result = get_client()->blockchain_get_transaction(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("transaction_id_prefix"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id_prefix'");
std::string transaction_id_prefix = parameters["transaction_id_prefix"].as<std::string>();
bool exact = parameters.contains("exact") ?
(fc::json::from_string("false").as<bool>()) :
parameters["exact"].as<bool>();
std::pair<TiValue::blockchain::TransactionIdType, TiValue::blockchain::TransactionEntry> result = get_client()->blockchain_get_transaction(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_pretty_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id_prefix)");
std::string transaction_id_prefix = parameters[0].as<std::string>();
bool exact = (parameters.size() <= 1) ?
(fc::json::from_string("false").as<bool>()) :
parameters[1].as<bool>();
TiValue::wallet::PrettyTransaction result = get_client()->blockchain_get_pretty_transaction(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_pretty_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("transaction_id_prefix"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id_prefix'");
std::string transaction_id_prefix = parameters["transaction_id_prefix"].as<std::string>();
bool exact = parameters.contains("exact") ?
(fc::json::from_string("false").as<bool>()) :
parameters["exact"].as<bool>();
TiValue::wallet::PrettyTransaction result = get_client()->blockchain_get_pretty_transaction(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_pretty_contract_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id_prefix)");
std::string transaction_id_prefix = parameters[0].as<std::string>();
bool exact = (parameters.size() <= 1) ?
(fc::json::from_string("false").as<bool>()) :
parameters[1].as<bool>();
TiValue::wallet::PrettyContractTransaction result = get_client()->blockchain_get_pretty_contract_transaction(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_pretty_contract_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("transaction_id_prefix"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id_prefix'");
std::string transaction_id_prefix = parameters["transaction_id_prefix"].as<std::string>();
bool exact = parameters.contains("exact") ?
(fc::json::from_string("false").as<bool>()) :
parameters["exact"].as<bool>();
TiValue::wallet::PrettyContractTransaction result = get_client()->blockchain_get_pretty_contract_transaction(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (block)");
std::string block = parameters[0].as<std::string>();
fc::optional<TiValue::blockchain::BlockEntry> result = get_client()->blockchain_get_block(block);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("block"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'block'");
std::string block = parameters["block"].as<std::string>();
fc::optional<TiValue::blockchain::BlockEntry> result = get_client()->blockchain_get_block(block);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_transactions_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (block)");
std::string block = parameters[0].as<std::string>();
std::map<TiValue::blockchain::TransactionIdType, TiValue::blockchain::TransactionEntry> result = get_client()->blockchain_get_block_transactions(block);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_transactions_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("block"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'block'");
std::string block = parameters["block"].as<std::string>();
std::map<TiValue::blockchain::TransactionIdType, TiValue::blockchain::TransactionEntry> result = get_client()->blockchain_get_block_transactions(block);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_account_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account)");
std::string account = parameters[0].as<std::string>();
fc::optional<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_get_account(account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_account_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account'");
std::string account = parameters["account"].as<std::string>();
fc::optional<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_get_account(account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_slate_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (slate)");
std::string slate = parameters[0].as<std::string>();
std::map<TiValue::blockchain::AccountIdType, std::string> result = get_client()->blockchain_get_slate(slate);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_slate_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("slate"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'slate'");
std::string slate = parameters["slate"].as<std::string>();
std::map<TiValue::blockchain::AccountIdType, std::string> result = get_client()->blockchain_get_slate(slate);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (balance_id)");
TiValue::blockchain::Address balance_id = parameters[0].as<TiValue::blockchain::Address>();
TiValue::blockchain::BalanceEntry result = get_client()->blockchain_get_balance(balance_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("balance_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'balance_id'");
TiValue::blockchain::Address balance_id = parameters["balance_id"].as<TiValue::blockchain::Address>();
TiValue::blockchain::BalanceEntry result = get_client()->blockchain_get_balance(balance_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_balances_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::string first_balance_id = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
uint32_t limit = (parameters.size() <= 1) ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::unordered_map<TiValue::blockchain::BalanceIdType, TiValue::blockchain::BalanceEntry> result = get_client()->blockchain_list_balances(first_balance_id, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_balances_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::string first_balance_id = parameters.contains("first_balance_id") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["first_balance_id"].as<std::string>();
uint32_t limit = parameters.contains("limit") ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters["limit"].as<uint32_t>();
std::unordered_map<TiValue::blockchain::BalanceIdType, TiValue::blockchain::BalanceEntry> result = get_client()->blockchain_list_balances(first_balance_id, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_address_balances_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (addr)");
std::string addr = parameters[0].as<std::string>();
fc::time_point chanced_since = (parameters.size() <= 1) ?
(fc::json::from_string("\"1970-1-1T00:00:01\"").as<fc::time_point>()) :
parameters[1].as<fc::time_point>();
std::unordered_map<TiValue::blockchain::BalanceIdType, TiValue::blockchain::BalanceEntry> result = get_client()->blockchain_list_address_balances(addr, chanced_since);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_address_balances_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("addr"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'addr'");
std::string addr = parameters["addr"].as<std::string>();
fc::time_point chanced_since = parameters.contains("chanced_since") ?
(fc::json::from_string("\"1970-1-1T00:00:01\"").as<fc::time_point>()) :
parameters["chanced_since"].as<fc::time_point>();
std::unordered_map<TiValue::blockchain::BalanceIdType, TiValue::blockchain::BalanceEntry> result = get_client()->blockchain_list_address_balances(addr, chanced_since);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_address_transactions_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (addr)");
std::string addr = parameters[0].as<std::string>();
uint32_t filter_before = (parameters.size() <= 1) ?
(fc::json::from_string("\"0\"").as<uint32_t>()) :
parameters[1].as<uint32_t>();
fc::variant_object result = get_client()->blockchain_list_address_transactions(addr, filter_before);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_address_transactions_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("addr"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'addr'");
std::string addr = parameters["addr"].as<std::string>();
uint32_t filter_before = parameters.contains("filter_before") ?
(fc::json::from_string("\"0\"").as<uint32_t>()) :
parameters["filter_before"].as<uint32_t>();
fc::variant_object result = get_client()->blockchain_list_address_transactions(addr, filter_before);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_account_public_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->blockchain_get_account_public_balance(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_account_public_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->blockchain_get_account_public_balance(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_key_balances_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (key)");
TiValue::blockchain::PublicKeyType key = parameters[0].as<TiValue::blockchain::PublicKeyType>();
std::unordered_map<TiValue::blockchain::BalanceIdType, TiValue::blockchain::BalanceEntry> result = get_client()->blockchain_list_key_balances(key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_key_balances_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("key"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'key'");
TiValue::blockchain::PublicKeyType key = parameters["key"].as<TiValue::blockchain::PublicKeyType>();
std::unordered_map<TiValue::blockchain::BalanceIdType, TiValue::blockchain::BalanceEntry> result = get_client()->blockchain_list_key_balances(key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_asset_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (asset)");
std::string asset = parameters[0].as<std::string>();
fc::optional<TiValue::blockchain::AssetEntry> result = get_client()->blockchain_get_asset(asset);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_asset_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("asset"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset'");
std::string asset = parameters["asset"].as<std::string>();
fc::optional<TiValue::blockchain::AssetEntry> result = get_client()->blockchain_get_asset(asset);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_active_delegates_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
uint32_t first = (parameters.size() <= 0) ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters[0].as<uint32_t>();
uint32_t count = (parameters.size() <= 1) ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_active_delegates(first, count);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_active_delegates_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
uint32_t first = parameters.contains("first") ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters["first"].as<uint32_t>();
uint32_t count = parameters.contains("count") ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters["count"].as<uint32_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_active_delegates(first, count);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_delegates_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
uint32_t first = (parameters.size() <= 0) ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters[0].as<uint32_t>();
uint32_t count = (parameters.size() <= 1) ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_delegates(first, count);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_delegates_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
uint32_t first = parameters.contains("first") ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters["first"].as<uint32_t>();
uint32_t count = parameters.contains("count") ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters["count"].as<uint32_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->blockchain_list_delegates(first, count);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_blocks_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
uint32_t max_block_num = (parameters.size() <= 0) ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters[0].as<uint32_t>();
uint32_t limit = (parameters.size() <= 1) ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::vector<TiValue::blockchain::BlockEntry> result = get_client()->blockchain_list_blocks(max_block_num, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_blocks_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
uint32_t max_block_num = parameters.contains("max_block_num") ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters["max_block_num"].as<uint32_t>();
uint32_t limit = parameters.contains("limit") ?
(fc::json::from_string("20").as<uint32_t>()) :
parameters["limit"].as<uint32_t>();
std::vector<TiValue::blockchain::BlockEntry> result = get_client()->blockchain_list_blocks(max_block_num, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_missing_block_delegates_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (block_number)");
uint32_t block_number = parameters[0].as<uint32_t>();
std::vector<std::string> result = get_client()->blockchain_list_missing_block_delegates(block_number);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_missing_block_delegates_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("block_number"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'block_number'");
uint32_t block_number = parameters["block_number"].as<uint32_t>();
std::vector<std::string> result = get_client()->blockchain_list_missing_block_delegates(block_number);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_export_fork_graph_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
uint32_t start_block = (parameters.size() <= 0) ?
(fc::json::from_string("1").as<uint32_t>()) :
parameters[0].as<uint32_t>();
uint32_t end_block = (parameters.size() <= 1) ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters[1].as<uint32_t>();
TiValue::blockchain::FilePath filename = (parameters.size() <= 2) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::FilePath>()) :
parameters[2].as<TiValue::blockchain::FilePath>();
std::string result = get_client()->blockchain_export_fork_graph(start_block, end_block, filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_export_fork_graph_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
uint32_t start_block = parameters.contains("start_block") ?
(fc::json::from_string("1").as<uint32_t>()) :
parameters["start_block"].as<uint32_t>();
uint32_t end_block = parameters.contains("end_block") ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters["end_block"].as<uint32_t>();
TiValue::blockchain::FilePath filename = parameters.contains("filename") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::FilePath>()) :
parameters["filename"].as<TiValue::blockchain::FilePath>();
std::string result = get_client()->blockchain_export_fork_graph(start_block, end_block, filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_forks_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::map<uint32_t, std::vector<TiValue::blockchain::ForkEntry>> result = get_client()->blockchain_list_forks();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_forks_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::map<uint32_t, std::vector<TiValue::blockchain::ForkEntry>> result = get_client()->blockchain_list_forks();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_delegate_slot_entrys_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (delegate_name)");
std::string delegate_name = parameters[0].as<std::string>();
uint32_t limit = (parameters.size() <= 1) ?
(fc::json::from_string("\"10\"").as<uint32_t>()) :
parameters[1].as<uint32_t>();
std::vector<TiValue::blockchain::SlotEntry> result = get_client()->blockchain_get_delegate_slot_entrys(delegate_name, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_delegate_slot_entrys_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("delegate_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'delegate_name'");
std::string delegate_name = parameters["delegate_name"].as<std::string>();
uint32_t limit = parameters.contains("limit") ?
(fc::json::from_string("\"10\"").as<uint32_t>()) :
parameters["limit"].as<uint32_t>();
std::vector<TiValue::blockchain::SlotEntry> result = get_client()->blockchain_get_delegate_slot_entrys(delegate_name, limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_signee_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (block)");
std::string block = parameters[0].as<std::string>();
std::string result = get_client()->blockchain_get_block_signee(block);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_block_signee_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("block"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'block'");
std::string block = parameters["block"].as<std::string>();
std::string result = get_client()->blockchain_get_block_signee(block);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_unclaimed_genesis_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
TiValue::blockchain::Asset result = get_client()->blockchain_unclaimed_genesis();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_unclaimed_genesis_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
TiValue::blockchain::Asset result = get_client()->blockchain_unclaimed_genesis();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_verify_signature_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (signer)");
std::string signer = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (hash)");
fc::sha256 hash = parameters[1].as<fc::sha256>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (signature)");
fc::ecc::compact_signature signature = parameters[2].as<fc::ecc::compact_signature>();
bool result = get_client()->blockchain_verify_signature(signer, hash, signature);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_verify_signature_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("signer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'signer'");
std::string signer = parameters["signer"].as<std::string>();
if (!parameters.contains("hash"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'hash'");
fc::sha256 hash = parameters["hash"].as<fc::sha256>();
if (!parameters.contains("signature"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'signature'");
fc::ecc::compact_signature signature = parameters["signature"].as<fc::ecc::compact_signature>();
bool result = get_client()->blockchain_verify_signature(signer, hash, signature);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_dump_state_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (path)");
std::string path = parameters[0].as<std::string>();
get_client()->blockchain_dump_state(path);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_dump_state_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("path"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'path'");
std::string path = parameters["path"].as<std::string>();
get_client()->blockchain_dump_state(path);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_broadcast_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (trx)");
TiValue::blockchain::SignedTransaction trx = parameters[0].as<TiValue::blockchain::SignedTransaction>();
get_client()->blockchain_broadcast_transaction(trx);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_broadcast_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("trx"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'trx'");
TiValue::blockchain::SignedTransaction trx = parameters["trx"].as<TiValue::blockchain::SignedTransaction>();
get_client()->blockchain_broadcast_transaction(trx);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_btc_address_convert_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (path)");
std::string path = parameters[0].as<std::string>();
get_client()->blockchain_btc_address_convert(path);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_btc_address_convert_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("path"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'path'");
std::string path = parameters["path"].as<std::string>();
get_client()->blockchain_btc_address_convert(path);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_get_transaction_rpc_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id_prefix)");
std::string transaction_id_prefix = parameters[0].as<std::string>();
bool exact = (parameters.size() <= 1) ?
(fc::json::from_string("false").as<bool>()) :
parameters[1].as<bool>();
std::string result = get_client()->blockchain_get_transaction_rpc(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_transaction_rpc_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("transaction_id_prefix"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id_prefix'");
std::string transaction_id_prefix = parameters["transaction_id_prefix"].as<std::string>();
bool exact = parameters.contains("exact") ?
(fc::json::from_string("false").as<bool>()) :
parameters["exact"].as<bool>();
std::string result = get_client()->blockchain_get_transaction_rpc(transaction_id_prefix, exact);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_set_node_vm_enabled_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (enabled)");
bool enabled = parameters[0].as<bool>();
get_client()->blockchain_set_node_vm_enabled(enabled);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_set_node_vm_enabled_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("enabled"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'enabled'");
bool enabled = parameters["enabled"].as<bool>();
get_client()->blockchain_set_node_vm_enabled(enabled);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_get_node_vm_enabled_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
bool result = get_client()->blockchain_get_node_vm_enabled();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_node_vm_enabled_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
bool result = get_client()->blockchain_get_node_vm_enabled();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_all_contracts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
vector<string> result = get_client()->blockchain_get_all_contracts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_all_contracts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
vector<string> result = get_client()->blockchain_get_all_contracts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_forever_contracts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
unordered_map<string, string> result = get_client()->blockchain_get_forever_contracts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_forever_contracts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
unordered_map<string, string> result = get_client()->blockchain_get_forever_contracts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_pub_all_address_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (pub_key)");
std::string pub_key = parameters[0].as<std::string>();
std::vector<std::string> result = get_client()->blockchain_list_pub_all_address(pub_key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_pub_all_address_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("pub_key"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'pub_key'");
std::string pub_key = parameters["pub_key"].as<std::string>();
std::vector<std::string> result = get_client()->blockchain_list_pub_all_address(pub_key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_add_node_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (node)");
std::string node = parameters[0].as<std::string>();
std::string command = (parameters.size() <= 1) ?
(fc::json::from_string("\"add\"").as<std::string>()) :
parameters[1].as<std::string>();
get_client()->network_add_node(node, command);
return fc::variant();
}
fc::variant CommonApiRpcServer::network_add_node_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("node"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'node'");
std::string node = parameters["node"].as<std::string>();
std::string command = parameters.contains("command") ?
(fc::json::from_string("\"add\"").as<std::string>()) :
parameters["command"].as<std::string>();
get_client()->network_add_node(node, command);
return fc::variant();
}
fc::variant CommonApiRpcServer::network_get_connection_count_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
uint32_t result = get_client()->network_get_connection_count();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_connection_count_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
uint32_t result = get_client()->network_get_connection_count();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_peer_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
bool not_firewalled = (parameters.size() <= 0) ?
(fc::json::from_string("false").as<bool>()) :
parameters[0].as<bool>();
std::vector<fc::variant_object> result = get_client()->network_get_peer_info(not_firewalled);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_peer_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
bool not_firewalled = parameters.contains("not_firewalled") ?
(fc::json::from_string("false").as<bool>()) :
parameters["not_firewalled"].as<bool>();
std::vector<fc::variant_object> result = get_client()->network_get_peer_info(not_firewalled);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_broadcast_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_connected_to_network();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_to_broadcast)");
TiValue::blockchain::SignedTransaction transaction_to_broadcast = parameters[0].as<TiValue::blockchain::SignedTransaction>();
TiValue::blockchain::TransactionIdType result = get_client()->network_broadcast_transaction(transaction_to_broadcast);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_broadcast_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_connected_to_network();
// done checking prerequisites
if (!parameters.contains("transaction_to_broadcast"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_to_broadcast'");
TiValue::blockchain::SignedTransaction transaction_to_broadcast = parameters["transaction_to_broadcast"].as<TiValue::blockchain::SignedTransaction>();
TiValue::blockchain::TransactionIdType result = get_client()->network_broadcast_transaction(transaction_to_broadcast);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_set_advanced_node_parameters_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (params)");
fc::variant_object params = parameters[0].as<fc::variant_object>();
get_client()->network_set_advanced_node_parameters(params);
return fc::variant();
}
fc::variant CommonApiRpcServer::network_set_advanced_node_parameters_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("params"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'params'");
fc::variant_object params = parameters["params"].as<fc::variant_object>();
get_client()->network_set_advanced_node_parameters(params);
return fc::variant();
}
fc::variant CommonApiRpcServer::network_get_advanced_node_parameters_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->network_get_advanced_node_parameters();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_advanced_node_parameters_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->network_get_advanced_node_parameters();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_transaction_propagation_data_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id)");
TiValue::blockchain::TransactionIdType transaction_id = parameters[0].as<TiValue::blockchain::TransactionIdType>();
TiValue::net::MessagePropagationData result = get_client()->network_get_transaction_propagation_data(transaction_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_transaction_propagation_data_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("transaction_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id'");
TiValue::blockchain::TransactionIdType transaction_id = parameters["transaction_id"].as<TiValue::blockchain::TransactionIdType>();
TiValue::net::MessagePropagationData result = get_client()->network_get_transaction_propagation_data(transaction_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_block_propagation_data_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (block_hash)");
TiValue::blockchain::BlockIdType block_hash = parameters[0].as<TiValue::blockchain::BlockIdType>();
TiValue::net::MessagePropagationData result = get_client()->network_get_block_propagation_data(block_hash);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_block_propagation_data_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("block_hash"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'block_hash'");
TiValue::blockchain::BlockIdType block_hash = parameters["block_hash"].as<TiValue::blockchain::BlockIdType>();
TiValue::net::MessagePropagationData result = get_client()->network_get_block_propagation_data(block_hash);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->network_get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->network_get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_list_potential_peers_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::vector<TiValue::net::PotentialPeerEntry> result = get_client()->network_list_potential_peers();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_list_potential_peers_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::vector<TiValue::net::PotentialPeerEntry> result = get_client()->network_list_potential_peers();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_upnp_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->network_get_upnp_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_upnp_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->network_get_upnp_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_blocked_ips_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::vector<std::string> result = get_client()->network_get_blocked_ips();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::network_get_blocked_ips_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::vector<std::string> result = get_client()->network_get_blocked_ips();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::debug_get_client_name_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::string result = get_client()->debug_get_client_name();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::debug_get_client_name_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::string result = get_client()->debug_get_client_name();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::delegate_get_config_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
fc::variant result = get_client()->delegate_get_config();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::delegate_get_config_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
fc::variant result = get_client()->delegate_get_config();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::delegate_set_network_min_connection_count_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (count)");
uint32_t count = parameters[0].as<uint32_t>();
get_client()->delegate_set_network_min_connection_count(count);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_network_min_connection_count_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("count"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'count'");
uint32_t count = parameters["count"].as<uint32_t>();
get_client()->delegate_set_network_min_connection_count(count);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_block_max_transaction_count_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (count)");
uint32_t count = parameters[0].as<uint32_t>();
get_client()->delegate_set_block_max_transaction_count(count);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_block_max_transaction_count_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("count"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'count'");
uint32_t count = parameters["count"].as<uint32_t>();
get_client()->delegate_set_block_max_transaction_count(count);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_soft_max_imessage_length_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (soft_length)");
int64_t soft_length = parameters[0].as<int64_t>();
get_client()->delegate_set_soft_max_imessage_length(soft_length);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_soft_max_imessage_length_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("soft_length"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'soft_length'");
int64_t soft_length = parameters["soft_length"].as<int64_t>();
get_client()->delegate_set_soft_max_imessage_length(soft_length);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_imessage_fee_coe_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (fee_coe)");
std::string fee_coe = parameters[0].as<std::string>();
get_client()->delegate_set_imessage_fee_coe(fee_coe);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_imessage_fee_coe_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("fee_coe"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'fee_coe'");
std::string fee_coe = parameters["fee_coe"].as<std::string>();
get_client()->delegate_set_imessage_fee_coe(fee_coe);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_block_max_size_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (size)");
uint32_t size = parameters[0].as<uint32_t>();
get_client()->delegate_set_block_max_size(size);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_block_max_size_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("size"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'size'");
uint32_t size = parameters["size"].as<uint32_t>();
get_client()->delegate_set_block_max_size(size);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_transaction_max_size_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (size)");
uint32_t size = parameters[0].as<uint32_t>();
get_client()->delegate_set_transaction_max_size(size);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_transaction_max_size_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("size"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'size'");
uint32_t size = parameters["size"].as<uint32_t>();
get_client()->delegate_set_transaction_max_size(size);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_transaction_canonical_signatures_required_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (required)");
bool required = parameters[0].as<bool>();
get_client()->delegate_set_transaction_canonical_signatures_required(required);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_transaction_canonical_signatures_required_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("required"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'required'");
bool required = parameters["required"].as<bool>();
get_client()->delegate_set_transaction_canonical_signatures_required(required);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_transaction_min_fee_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (fee)");
std::string fee = parameters[0].as<std::string>();
get_client()->delegate_set_transaction_min_fee(fee);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_set_transaction_min_fee_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("fee"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'fee'");
std::string fee = parameters["fee"].as<std::string>();
get_client()->delegate_set_transaction_min_fee(fee);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_add_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (id)");
TiValue::blockchain::TransactionIdType id = parameters[0].as<TiValue::blockchain::TransactionIdType>();
get_client()->delegate_blacklist_add_transaction(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_add_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'id'");
TiValue::blockchain::TransactionIdType id = parameters["id"].as<TiValue::blockchain::TransactionIdType>();
get_client()->delegate_blacklist_add_transaction(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_remove_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (id)");
TiValue::blockchain::TransactionIdType id = parameters[0].as<TiValue::blockchain::TransactionIdType>();
get_client()->delegate_blacklist_remove_transaction(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_remove_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'id'");
TiValue::blockchain::TransactionIdType id = parameters["id"].as<TiValue::blockchain::TransactionIdType>();
get_client()->delegate_blacklist_remove_transaction(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_add_operation_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (id)");
TiValue::blockchain::OperationTypeEnum id = parameters[0].as<TiValue::blockchain::OperationTypeEnum>();
get_client()->delegate_blacklist_add_operation(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_add_operation_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'id'");
TiValue::blockchain::OperationTypeEnum id = parameters["id"].as<TiValue::blockchain::OperationTypeEnum>();
get_client()->delegate_blacklist_add_operation(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_remove_operation_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (id)");
TiValue::blockchain::OperationTypeEnum id = parameters[0].as<TiValue::blockchain::OperationTypeEnum>();
get_client()->delegate_blacklist_remove_operation(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delegate_blacklist_remove_operation_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'id'");
TiValue::blockchain::OperationTypeEnum id = parameters["id"].as<TiValue::blockchain::OperationTypeEnum>();
get_client()->delegate_blacklist_remove_operation(id);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->wallet_get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant_object result = get_client()->wallet_get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_open_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (wallet_name)");
std::string wallet_name = parameters[0].as<std::string>();
get_client()->wallet_open(wallet_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_open_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("wallet_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'wallet_name'");
std::string wallet_name = parameters["wallet_name"].as<std::string>();
get_client()->wallet_open(wallet_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_create_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (wallet_name)");
std::string wallet_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (new_passphrase)");
std::string new_passphrase = parameters[1].as<std::string>();
std::string brain_key = (parameters.size() <= 2) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[2].as<std::string>();
get_client()->wallet_create(wallet_name, new_passphrase, brain_key);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_create_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("wallet_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'wallet_name'");
std::string wallet_name = parameters["wallet_name"].as<std::string>();
if (!parameters.contains("new_passphrase"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_passphrase'");
std::string new_passphrase = parameters["new_passphrase"].as<std::string>();
std::string brain_key = parameters.contains("brain_key") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["brain_key"].as<std::string>();
get_client()->wallet_create(wallet_name, new_passphrase, brain_key);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_name_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
fc::optional<std::string> result = get_client()->wallet_get_name();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_name_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
fc::optional<std::string> result = get_client()->wallet_get_name();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_import_private_key_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (wif_key)");
std::string wif_key = parameters[0].as<std::string>();
std::string account_name = (parameters.size() <= 1) ?
(fc::json::from_string("null").as<std::string>()) :
parameters[1].as<std::string>();
bool create_new_account = (parameters.size() <= 2) ?
(fc::json::from_string("false").as<bool>()) :
parameters[2].as<bool>();
bool rescan = (parameters.size() <= 3) ?
(fc::json::from_string("false").as<bool>()) :
parameters[3].as<bool>();
std::string result = get_client()->wallet_import_private_key(wif_key, account_name, create_new_account, rescan);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_import_private_key_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("wif_key"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'wif_key'");
std::string wif_key = parameters["wif_key"].as<std::string>();
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("null").as<std::string>()) :
parameters["account_name"].as<std::string>();
bool create_new_account = parameters.contains("create_new_account") ?
(fc::json::from_string("false").as<bool>()) :
parameters["create_new_account"].as<bool>();
bool rescan = parameters.contains("rescan") ?
(fc::json::from_string("false").as<bool>()) :
parameters["rescan"].as<bool>();
std::string result = get_client()->wallet_import_private_key(wif_key, account_name, create_new_account, rescan);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_close_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
get_client()->wallet_close();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_close_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
get_client()->wallet_close();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_backup_create_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (json_filename)");
fc::path json_filename = parameters[0].as<fc::path>();
get_client()->wallet_backup_create(json_filename);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_backup_create_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("json_filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'json_filename'");
fc::path json_filename = parameters["json_filename"].as<fc::path>();
get_client()->wallet_backup_create(json_filename);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_backup_restore_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (json_filename)");
fc::path json_filename = parameters[0].as<fc::path>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (wallet_name)");
std::string wallet_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (imported_wallet_passphrase)");
std::string imported_wallet_passphrase = parameters[2].as<std::string>();
get_client()->wallet_backup_restore(json_filename, wallet_name, imported_wallet_passphrase);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_backup_restore_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("json_filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'json_filename'");
fc::path json_filename = parameters["json_filename"].as<fc::path>();
if (!parameters.contains("wallet_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'wallet_name'");
std::string wallet_name = parameters["wallet_name"].as<std::string>();
if (!parameters.contains("imported_wallet_passphrase"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'imported_wallet_passphrase'");
std::string imported_wallet_passphrase = parameters["imported_wallet_passphrase"].as<std::string>();
get_client()->wallet_backup_restore(json_filename, wallet_name, imported_wallet_passphrase);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_set_automatic_backups_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (enabled)");
bool enabled = parameters[0].as<bool>();
bool result = get_client()->wallet_set_automatic_backups(enabled);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_automatic_backups_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("enabled"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'enabled'");
bool enabled = parameters["enabled"].as<bool>();
bool result = get_client()->wallet_set_automatic_backups(enabled);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_expiration_time_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (seconds)");
uint32_t seconds = parameters[0].as<uint32_t>();
uint32_t result = get_client()->wallet_set_transaction_expiration_time(seconds);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_expiration_time_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("seconds"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'seconds'");
uint32_t seconds = parameters["seconds"].as<uint32_t>();
uint32_t result = get_client()->wallet_set_transaction_expiration_time(seconds);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_transaction_history_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
std::string asset_symbol = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
int32_t limit = (parameters.size() <= 2) ?
(fc::json::from_string("0").as<int32_t>()) :
parameters[2].as<int32_t>();
uint32_t start_block_num = (parameters.size() <= 3) ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters[3].as<uint32_t>();
uint32_t end_block_num = (parameters.size() <= 4) ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters[4].as<uint32_t>();
std::vector<TiValue::wallet::PrettyTransaction> result = get_client()->wallet_account_transaction_history(account_name, asset_symbol, limit, start_block_num, end_block_num);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_transaction_history_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
std::string asset_symbol = parameters.contains("asset_symbol") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["asset_symbol"].as<std::string>();
int32_t limit = parameters.contains("limit") ?
(fc::json::from_string("0").as<int32_t>()) :
parameters["limit"].as<int32_t>();
uint32_t start_block_num = parameters.contains("start_block_num") ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters["start_block_num"].as<uint32_t>();
uint32_t end_block_num = parameters.contains("end_block_num") ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters["end_block_num"].as<uint32_t>();
std::vector<TiValue::wallet::PrettyTransaction> result = get_client()->wallet_account_transaction_history(account_name, asset_symbol, limit, start_block_num, end_block_num);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transaction_history_splite_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
std::string asset_symbol = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
int32_t limit = (parameters.size() <= 2) ?
(fc::json::from_string("0").as<int32_t>()) :
parameters[2].as<int32_t>();
int32_t transaction_type = (parameters.size() <= 3) ?
(fc::json::from_string("\"2\"").as<int32_t>()) :
parameters[3].as<int32_t>();
std::vector<TiValue::wallet::PrettyTransaction> result = get_client()->wallet_transaction_history_splite(account_name, asset_symbol, limit, transaction_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transaction_history_splite_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
std::string asset_symbol = parameters.contains("asset_symbol") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["asset_symbol"].as<std::string>();
int32_t limit = parameters.contains("limit") ?
(fc::json::from_string("0").as<int32_t>()) :
parameters["limit"].as<int32_t>();
int32_t transaction_type = parameters.contains("transaction_type") ?
(fc::json::from_string("\"2\"").as<int32_t>()) :
parameters["transaction_type"].as<int32_t>();
std::vector<TiValue::wallet::PrettyTransaction> result = get_client()->wallet_transaction_history_splite(account_name, asset_symbol, limit, transaction_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_historic_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (time)");
fc::time_point time = parameters[0].as<fc::time_point>();
std::string account_name = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->wallet_account_historic_balance(time, account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_historic_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("time"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'time'");
fc::time_point time = parameters["time"].as<fc::time_point>();
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->wallet_account_historic_balance(time, account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_remove_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id)");
std::string transaction_id = parameters[0].as<std::string>();
get_client()->wallet_remove_transaction(transaction_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_remove_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("transaction_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id'");
std::string transaction_id = parameters["transaction_id"].as<std::string>();
get_client()->wallet_remove_transaction(transaction_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_pending_transaction_errors_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
TiValue::blockchain::FilePath filename = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::FilePath>()) :
parameters[0].as<TiValue::blockchain::FilePath>();
std::map<TiValue::blockchain::TransactionIdType, fc::exception> result = get_client()->wallet_get_pending_transaction_errors(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_pending_transaction_errors_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
TiValue::blockchain::FilePath filename = parameters.contains("filename") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::FilePath>()) :
parameters["filename"].as<TiValue::blockchain::FilePath>();
std::map<TiValue::blockchain::TransactionIdType, fc::exception> result = get_client()->wallet_get_pending_transaction_errors(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_lock_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
get_client()->wallet_lock();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_lock_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
get_client()->wallet_lock();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_unlock_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (timeout)");
uint32_t timeout = parameters[0].as<uint32_t>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (passphrase)");
std::string passphrase = parameters[1].as<std::string>();
get_client()->wallet_unlock(timeout, passphrase);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_unlock_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("timeout"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'timeout'");
uint32_t timeout = parameters["timeout"].as<uint32_t>();
if (!parameters.contains("passphrase"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'passphrase'");
std::string passphrase = parameters["passphrase"].as<std::string>();
get_client()->wallet_unlock(timeout, passphrase);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_change_passphrase_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (old_passphrase)");
std::string old_passphrase = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (passphrase)");
std::string passphrase = parameters[1].as<std::string>();
get_client()->wallet_change_passphrase(old_passphrase, passphrase);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_change_passphrase_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("old_passphrase"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'old_passphrase'");
std::string old_passphrase = parameters["old_passphrase"].as<std::string>();
if (!parameters.contains("passphrase"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'passphrase'");
std::string passphrase = parameters["passphrase"].as<std::string>();
get_client()->wallet_change_passphrase(old_passphrase, passphrase);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_check_passphrase_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (passphrase)");
std::string passphrase = parameters[0].as<std::string>();
bool result = get_client()->wallet_check_passphrase(passphrase);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_check_passphrase_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("passphrase"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'passphrase'");
std::string passphrase = parameters["passphrase"].as<std::string>();
bool result = get_client()->wallet_check_passphrase(passphrase);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_check_address_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (address)");
std::string address = parameters[0].as<std::string>();
bool result = get_client()->wallet_check_address(address);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_check_address_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'address'");
std::string address = parameters["address"].as<std::string>();
bool result = get_client()->wallet_check_address(address);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::vector<std::string> result = get_client()->wallet_list();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::vector<std::string> result = get_client()->wallet_list();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_create_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
fc::variant private_data = (parameters.size() <= 1) ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters[1].as<fc::variant>();
TiValue::blockchain::Address result = get_client()->wallet_account_create(account_name, private_data);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_create_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
fc::variant private_data = parameters.contains("private_data") ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters["private_data"].as<fc::variant>();
TiValue::blockchain::Address result = get_client()->wallet_account_create(account_name, private_data);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_set_approval_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
int8_t approval = (parameters.size() <= 1) ?
(fc::json::from_string("1").as<int8_t>()) :
parameters[1].as<int8_t>();
int8_t result = get_client()->wallet_account_set_approval(account_name, approval);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_set_approval_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
int8_t approval = parameters.contains("approval") ?
(fc::json::from_string("1").as<int8_t>()) :
parameters["approval"].as<int8_t>();
int8_t result = get_client()->wallet_account_set_approval(account_name, approval);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_all_approved_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
int8_t approval = (parameters.size() <= 0) ?
(fc::json::from_string("1").as<int8_t>()) :
parameters[0].as<int8_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->wallet_get_all_approved_accounts(approval);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_all_approved_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
int8_t approval = parameters.contains("approval") ?
(fc::json::from_string("1").as<int8_t>()) :
parameters["approval"].as<int8_t>();
std::vector<TiValue::blockchain::AccountEntry> result = get_client()->wallet_get_all_approved_accounts(approval);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_address_create_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
std::string label = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
int32_t legacy_network_byte = (parameters.size() <= 2) ?
(fc::json::from_string("-1").as<int32_t>()) :
parameters[2].as<int32_t>();
std::string result = get_client()->wallet_address_create(account_name, label, legacy_network_byte);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_address_create_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
std::string label = parameters.contains("label") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["label"].as<std::string>();
int32_t legacy_network_byte = parameters.contains("legacy_network_byte") ?
(fc::json::from_string("-1").as<int32_t>()) :
parameters["legacy_network_byte"].as<int32_t>();
std::string result = get_client()->wallet_address_create(account_name, label, legacy_network_byte);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_address_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
std::string amount_to_transfer = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_address)");
std::string to_address = parameters[3].as<std::string>();
TiValue::blockchain::Imessage memo_message = (parameters.size() <= 4) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters[4].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = (parameters.size() <= 5) ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters[5].as<TiValue::wallet::VoteStrategy>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_transfer_to_address(amount_to_transfer, asset_symbol, from_account_name, to_address, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_address_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
std::string amount_to_transfer = parameters["amount_to_transfer"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_address'");
std::string to_address = parameters["to_address"].as<std::string>();
TiValue::blockchain::Imessage memo_message = parameters.contains("memo_message") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters["memo_message"].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = parameters.contains("strategy") ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters["strategy"].as<TiValue::wallet::VoteStrategy>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_transfer_to_address(amount_to_transfer, asset_symbol, from_account_name, to_address, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_public_account_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
std::string amount_to_transfer = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_account_name)");
std::string to_account_name = parameters[3].as<std::string>();
TiValue::blockchain::Imessage memo_message = (parameters.size() <= 4) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters[4].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = (parameters.size() <= 5) ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters[5].as<TiValue::wallet::VoteStrategy>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_transfer_to_public_account(amount_to_transfer, asset_symbol, from_account_name, to_account_name, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_public_account_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
std::string amount_to_transfer = parameters["amount_to_transfer"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_account_name'");
std::string to_account_name = parameters["to_account_name"].as<std::string>();
TiValue::blockchain::Imessage memo_message = parameters.contains("memo_message") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters["memo_message"].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = parameters.contains("strategy") ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters["strategy"].as<TiValue::wallet::VoteStrategy>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_transfer_to_public_account(amount_to_transfer, asset_symbol, from_account_name, to_account_name, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_withdraw_from_address_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount)");
std::string amount = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (symbol)");
std::string symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_address)");
TiValue::blockchain::Address from_address = parameters[2].as<TiValue::blockchain::Address>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to)");
std::string to = parameters[3].as<std::string>();
TiValue::wallet::VoteStrategy strategy = (parameters.size() <= 4) ?
(fc::json::from_string("\"vote_none\"").as<TiValue::wallet::VoteStrategy>()) :
parameters[4].as<TiValue::wallet::VoteStrategy>();
bool sign_and_broadcast = (parameters.size() <= 5) ?
(fc::json::from_string("true").as<bool>()) :
parameters[5].as<bool>();
std::string builder_path = (parameters.size() <= 6) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[6].as<std::string>();
TiValue::wallet::TransactionBuilder result = get_client()->wallet_withdraw_from_address(amount, symbol, from_address, to, strategy, sign_and_broadcast, builder_path);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_withdraw_from_address_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("amount"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount'");
std::string amount = parameters["amount"].as<std::string>();
if (!parameters.contains("symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'symbol'");
std::string symbol = parameters["symbol"].as<std::string>();
if (!parameters.contains("from_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_address'");
TiValue::blockchain::Address from_address = parameters["from_address"].as<TiValue::blockchain::Address>();
if (!parameters.contains("to"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to'");
std::string to = parameters["to"].as<std::string>();
TiValue::wallet::VoteStrategy strategy = parameters.contains("strategy") ?
(fc::json::from_string("\"vote_none\"").as<TiValue::wallet::VoteStrategy>()) :
parameters["strategy"].as<TiValue::wallet::VoteStrategy>();
bool sign_and_broadcast = parameters.contains("sign_and_broadcast") ?
(fc::json::from_string("true").as<bool>()) :
parameters["sign_and_broadcast"].as<bool>();
std::string builder_path = parameters.contains("builder_path") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["builder_path"].as<std::string>();
TiValue::wallet::TransactionBuilder result = get_client()->wallet_withdraw_from_address(amount, symbol, from_address, to, strategy, sign_and_broadcast, builder_path);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_rescan_blockchain_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
uint32_t start_block_num = (parameters.size() <= 0) ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters[0].as<uint32_t>();
uint32_t limit = (parameters.size() <= 1) ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters[1].as<uint32_t>();
get_client()->wallet_rescan_blockchain(start_block_num, limit);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_rescan_blockchain_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
uint32_t start_block_num = parameters.contains("start_block_num") ?
(fc::json::from_string("0").as<uint32_t>()) :
parameters["start_block_num"].as<uint32_t>();
uint32_t limit = parameters.contains("limit") ?
(fc::json::from_string("-1").as<uint32_t>()) :
parameters["limit"].as<uint32_t>();
get_client()->wallet_rescan_blockchain(start_block_num, limit);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_cancel_scan_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->wallet_cancel_scan();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_cancel_scan_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->wallet_cancel_scan();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id)");
std::string transaction_id = parameters[0].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_get_transaction(transaction_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("transaction_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id'");
std::string transaction_id = parameters["transaction_id"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_get_transaction(transaction_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_scan_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id)");
std::string transaction_id = parameters[0].as<std::string>();
bool overwrite_existing = (parameters.size() <= 1) ?
(fc::json::from_string("false").as<bool>()) :
parameters[1].as<bool>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_scan_transaction(transaction_id, overwrite_existing);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_scan_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("transaction_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id'");
std::string transaction_id = parameters["transaction_id"].as<std::string>();
bool overwrite_existing = parameters.contains("overwrite_existing") ?
(fc::json::from_string("false").as<bool>()) :
parameters["overwrite_existing"].as<bool>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_scan_transaction(transaction_id, overwrite_existing);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_rebroadcast_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id)");
std::string transaction_id = parameters[0].as<std::string>();
get_client()->wallet_rebroadcast_transaction(transaction_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_rebroadcast_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("transaction_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id'");
std::string transaction_id = parameters["transaction_id"].as<std::string>();
get_client()->wallet_rebroadcast_transaction(transaction_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_account_register_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (pay_from_account)");
std::string pay_from_account = parameters[1].as<std::string>();
fc::variant public_data = (parameters.size() <= 2) ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters[2].as<fc::variant>();
uint8_t delegate_pay_rate = (parameters.size() <= 3) ?
(fc::json::from_string("-1").as<uint8_t>()) :
parameters[3].as<uint8_t>();
std::string account_type = (parameters.size() <= 4) ?
(fc::json::from_string("\"titan_account\"").as<std::string>()) :
parameters[4].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_register(account_name, pay_from_account, public_data, delegate_pay_rate, account_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_register_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
if (!parameters.contains("pay_from_account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'pay_from_account'");
std::string pay_from_account = parameters["pay_from_account"].as<std::string>();
fc::variant public_data = parameters.contains("public_data") ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters["public_data"].as<fc::variant>();
uint8_t delegate_pay_rate = parameters.contains("delegate_pay_rate") ?
(fc::json::from_string("-1").as<uint8_t>()) :
parameters["delegate_pay_rate"].as<uint8_t>();
std::string account_type = parameters.contains("account_type") ?
(fc::json::from_string("\"titan_account\"").as<std::string>()) :
parameters["account_type"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_register(account_name, pay_from_account, public_data, delegate_pay_rate, account_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_update_private_data_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
fc::variant private_data = (parameters.size() <= 1) ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters[1].as<fc::variant>();
get_client()->wallet_account_update_private_data(account_name, private_data);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_account_update_private_data_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
fc::variant private_data = parameters.contains("private_data") ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters["private_data"].as<fc::variant>();
get_client()->wallet_account_update_private_data(account_name, private_data);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_account_update_registration_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (pay_from_account)");
std::string pay_from_account = parameters[1].as<std::string>();
fc::variant public_data = (parameters.size() <= 2) ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters[2].as<fc::variant>();
uint8_t delegate_pay_rate = (parameters.size() <= 3) ?
(fc::json::from_string("-1").as<uint8_t>()) :
parameters[3].as<uint8_t>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_update_registration(account_name, pay_from_account, public_data, delegate_pay_rate);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_update_registration_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
if (!parameters.contains("pay_from_account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'pay_from_account'");
std::string pay_from_account = parameters["pay_from_account"].as<std::string>();
fc::variant public_data = parameters.contains("public_data") ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters["public_data"].as<fc::variant>();
uint8_t delegate_pay_rate = parameters.contains("delegate_pay_rate") ?
(fc::json::from_string("-1").as<uint8_t>()) :
parameters["delegate_pay_rate"].as<uint8_t>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_update_registration(account_name, pay_from_account, public_data, delegate_pay_rate);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_update_active_key_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_to_update)");
std::string account_to_update = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (pay_from_account)");
std::string pay_from_account = parameters[1].as<std::string>();
std::string new_active_key = (parameters.size() <= 2) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[2].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_update_active_key(account_to_update, pay_from_account, new_active_key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_update_active_key_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_to_update"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_to_update'");
std::string account_to_update = parameters["account_to_update"].as<std::string>();
if (!parameters.contains("pay_from_account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'pay_from_account'");
std::string pay_from_account = parameters["pay_from_account"].as<std::string>();
std::string new_active_key = parameters.contains("new_active_key") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["new_active_key"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_update_active_key(account_to_update, pay_from_account, new_active_key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::WalletAccountEntry> result = get_client()->wallet_list_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::WalletAccountEntry> result = get_client()->wallet_list_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_unregistered_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::WalletAccountEntry> result = get_client()->wallet_list_unregistered_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_unregistered_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::WalletAccountEntry> result = get_client()->wallet_list_unregistered_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_my_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::WalletAccountEntry> result = get_client()->wallet_list_my_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_my_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::WalletAccountEntry> result = get_client()->wallet_list_my_accounts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_my_addresses_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::AccountAddressData> result = get_client()->wallet_list_my_addresses();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_my_addresses_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::vector<TiValue::wallet::AccountAddressData> result = get_client()->wallet_list_my_addresses();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_account_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
TiValue::wallet::WalletAccountEntry result = get_client()->wallet_get_account(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_account_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
TiValue::wallet::WalletAccountEntry result = get_client()->wallet_get_account(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_account_public_address_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
std::string result = get_client()->wallet_get_account_public_address(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_account_public_address_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
std::string result = get_client()->wallet_get_account_public_address(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_remove_contact_account_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
get_client()->wallet_remove_contact_account(account_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_remove_contact_account_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
get_client()->wallet_remove_contact_account(account_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_account_rename_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (current_account_name)");
std::string current_account_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (new_account_name)");
std::string new_account_name = parameters[1].as<std::string>();
get_client()->wallet_account_rename(current_account_name, new_account_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_account_rename_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("current_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'current_account_name'");
std::string current_account_name = parameters["current_account_name"].as<std::string>();
if (!parameters.contains("new_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_account_name'");
std::string new_account_name = parameters["new_account_name"].as<std::string>();
get_client()->wallet_account_rename(current_account_name, new_account_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_asset_create_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (symbol)");
std::string symbol = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_name)");
std::string asset_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (issuer_name)");
std::string issuer_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (description)");
std::string description = parameters[3].as<std::string>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (maximum_share_supply)");
std::string maximum_share_supply = parameters[4].as<std::string>();
if (parameters.size() <= 5)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 6 (precision)");
uint64_t precision = parameters[5].as<uint64_t>();
fc::variant public_data = (parameters.size() <= 6) ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters[6].as<fc::variant>();
bool is_market_issued = (parameters.size() <= 7) ?
(fc::json::from_string("false").as<bool>()) :
parameters[7].as<bool>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_asset_create(symbol, asset_name, issuer_name, description, maximum_share_supply, precision, public_data, is_market_issued);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_asset_create_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'symbol'");
std::string symbol = parameters["symbol"].as<std::string>();
if (!parameters.contains("asset_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_name'");
std::string asset_name = parameters["asset_name"].as<std::string>();
if (!parameters.contains("issuer_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'issuer_name'");
std::string issuer_name = parameters["issuer_name"].as<std::string>();
if (!parameters.contains("description"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'description'");
std::string description = parameters["description"].as<std::string>();
if (!parameters.contains("maximum_share_supply"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'maximum_share_supply'");
std::string maximum_share_supply = parameters["maximum_share_supply"].as<std::string>();
if (!parameters.contains("precision"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'precision'");
uint64_t precision = parameters["precision"].as<uint64_t>();
fc::variant public_data = parameters.contains("public_data") ?
(fc::json::from_string("null").as<fc::variant>()) :
parameters["public_data"].as<fc::variant>();
bool is_market_issued = parameters.contains("is_market_issued") ?
(fc::json::from_string("false").as<bool>()) :
parameters["is_market_issued"].as<bool>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_asset_create(symbol, asset_name, issuer_name, description, maximum_share_supply, precision, public_data, is_market_issued);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_asset_issue_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount)");
std::string amount = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (symbol)");
std::string symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (to_account_name)");
std::string to_account_name = parameters[2].as<std::string>();
TiValue::blockchain::Imessage memo_message = (parameters.size() <= 3) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters[3].as<TiValue::blockchain::Imessage>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_asset_issue(amount, symbol, to_account_name, memo_message);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_asset_issue_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("amount"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount'");
std::string amount = parameters["amount"].as<std::string>();
if (!parameters.contains("symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'symbol'");
std::string symbol = parameters["symbol"].as<std::string>();
if (!parameters.contains("to_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_account_name'");
std::string to_account_name = parameters["to_account_name"].as<std::string>();
TiValue::blockchain::Imessage memo_message = parameters.contains("memo_message") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters["memo_message"].as<TiValue::blockchain::Imessage>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_asset_issue(amount, symbol, to_account_name, memo_message);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_asset_issue_to_addresses_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (symbol)");
std::string symbol = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (addresses)");
std::map<std::string, TiValue::blockchain::ShareType> addresses = parameters[1].as<std::map<std::string, TiValue::blockchain::ShareType>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_asset_issue_to_addresses(symbol, addresses);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_asset_issue_to_addresses_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'symbol'");
std::string symbol = parameters["symbol"].as<std::string>();
if (!parameters.contains("addresses"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'addresses'");
std::map<std::string, TiValue::blockchain::ShareType> addresses = parameters["addresses"].as<std::map<std::string, TiValue::blockchain::ShareType>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_asset_issue_to_addresses(symbol, addresses);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->wallet_account_balance(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->wallet_account_balance(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_balance_ids_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
TiValue::wallet::AccountBalanceIdSummaryType result = get_client()->wallet_account_balance_ids(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_balance_ids_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
TiValue::wallet::AccountBalanceIdSummaryType result = get_client()->wallet_account_balance_ids(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_list_public_keys_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
std::vector<TiValue::wallet::PublicKeySummary> result = get_client()->wallet_account_list_public_keys(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_list_public_keys_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
std::vector<TiValue::wallet::PublicKeySummary> result = get_client()->wallet_account_list_public_keys(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_delegate_withdraw_pay_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (delegate_name)");
std::string delegate_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (to_account_name)");
std::string to_account_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (amount_to_withdraw)");
std::string amount_to_withdraw = parameters[2].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_delegate_withdraw_pay(delegate_name, to_account_name, amount_to_withdraw);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_delegate_withdraw_pay_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("delegate_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'delegate_name'");
std::string delegate_name = parameters["delegate_name"].as<std::string>();
if (!parameters.contains("to_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_account_name'");
std::string to_account_name = parameters["to_account_name"].as<std::string>();
if (!parameters.contains("amount_to_withdraw"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_withdraw'");
std::string amount_to_withdraw = parameters["amount_to_withdraw"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_delegate_withdraw_pay(delegate_name, to_account_name, amount_to_withdraw);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_delegate_pay_balance_query_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (delegate_name)");
std::string delegate_name = parameters[0].as<std::string>();
TiValue::blockchain::DelegatePaySalary result = get_client()->wallet_delegate_pay_balance_query(delegate_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_delegate_pay_balance_query_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("delegate_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'delegate_name'");
std::string delegate_name = parameters["delegate_name"].as<std::string>();
TiValue::blockchain::DelegatePaySalary result = get_client()->wallet_delegate_pay_balance_query(delegate_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_active_delegate_salary_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::map<std::string,TiValue::blockchain::DelegatePaySalary> result = get_client()->wallet_active_delegate_salary();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_active_delegate_salary_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::map<std::string,TiValue::blockchain::DelegatePaySalary> result = get_client()->wallet_active_delegate_salary();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_delegate_statue_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
bool result = get_client()->wallet_get_delegate_statue(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_delegate_statue_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
bool result = get_client()->wallet_get_delegate_statue(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_imessage_fee_coe_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (fee_coe)");
std::string fee_coe = parameters[0].as<std::string>();
get_client()->wallet_set_transaction_imessage_fee_coe(fee_coe);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_set_transaction_imessage_fee_coe_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("fee_coe"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'fee_coe'");
std::string fee_coe = parameters["fee_coe"].as<std::string>();
get_client()->wallet_set_transaction_imessage_fee_coe(fee_coe);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_transaction_imessage_fee_coe_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
double result = get_client()->wallet_get_transaction_imessage_fee_coe();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_transaction_imessage_fee_coe_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
double result = get_client()->wallet_get_transaction_imessage_fee_coe();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_imessage_soft_max_length_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (soft_length)");
int64_t soft_length = parameters[0].as<int64_t>();
get_client()->wallet_set_transaction_imessage_soft_max_length(soft_length);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_set_transaction_imessage_soft_max_length_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("soft_length"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'soft_length'");
int64_t soft_length = parameters["soft_length"].as<int64_t>();
get_client()->wallet_set_transaction_imessage_soft_max_length(soft_length);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_transaction_imessage_soft_max_length_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
int64_t result = get_client()->wallet_get_transaction_imessage_soft_max_length();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_transaction_imessage_soft_max_length_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
int64_t result = get_client()->wallet_get_transaction_imessage_soft_max_length();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_fee_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (fee)");
std::string fee = parameters[0].as<std::string>();
TiValue::blockchain::Asset result = get_client()->wallet_set_transaction_fee(fee);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_fee_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("fee"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'fee'");
std::string fee = parameters["fee"].as<std::string>();
TiValue::blockchain::Asset result = get_client()->wallet_set_transaction_fee(fee);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_transaction_fee_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string symbol = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
TiValue::blockchain::Asset result = get_client()->wallet_get_transaction_fee(symbol);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_transaction_fee_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string symbol = parameters.contains("symbol") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["symbol"].as<std::string>();
TiValue::blockchain::Asset result = get_client()->wallet_get_transaction_fee(symbol);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_dump_private_key_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (input)");
std::string input = parameters[0].as<std::string>();
fc::optional<std::string> result = get_client()->wallet_dump_private_key(input);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_dump_private_key_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("input"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'input'");
std::string input = parameters["input"].as<std::string>();
fc::optional<std::string> result = get_client()->wallet_dump_private_key(input);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_dump_account_private_key_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (key_type)");
TiValue::wallet::AccountKeyType key_type = parameters[1].as<TiValue::wallet::AccountKeyType>();
fc::optional<std::string> result = get_client()->wallet_dump_account_private_key(account_name, key_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_dump_account_private_key_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
if (!parameters.contains("key_type"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'key_type'");
TiValue::wallet::AccountKeyType key_type = parameters["key_type"].as<TiValue::wallet::AccountKeyType>();
fc::optional<std::string> result = get_client()->wallet_dump_account_private_key(account_name, key_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_vote_summary_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
TiValue::wallet::AccountVoteSummaryType result = get_client()->wallet_account_vote_summary(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_vote_summary_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
TiValue::wallet::AccountVoteSummaryType result = get_client()->wallet_account_vote_summary(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_check_vote_status_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account)");
std::string account = parameters[0].as<std::string>();
TiValue::wallet::VoteSummary result = get_client()->wallet_check_vote_status(account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_check_vote_status_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account'");
std::string account = parameters["account"].as<std::string>();
TiValue::wallet::VoteSummary result = get_client()->wallet_check_vote_status(account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_setting_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (name)");
std::string name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (value)");
fc::variant value = parameters[1].as<fc::variant>();
get_client()->wallet_set_setting(name, value);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_set_setting_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'name'");
std::string name = parameters["name"].as<std::string>();
if (!parameters.contains("value"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'value'");
fc::variant value = parameters["value"].as<fc::variant>();
get_client()->wallet_set_setting(name, value);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_get_setting_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (name)");
std::string name = parameters[0].as<std::string>();
fc::optional<fc::variant> result = get_client()->wallet_get_setting(name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_setting_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'name'");
std::string name = parameters["name"].as<std::string>();
fc::optional<fc::variant> result = get_client()->wallet_get_setting(name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_delegate_set_block_production_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (delegate_name)");
std::string delegate_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (enabled)");
bool enabled = parameters[1].as<bool>();
get_client()->wallet_delegate_set_block_production(delegate_name, enabled);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_delegate_set_block_production_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("delegate_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'delegate_name'");
std::string delegate_name = parameters["delegate_name"].as<std::string>();
if (!parameters.contains("enabled"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'enabled'");
bool enabled = parameters["enabled"].as<bool>();
get_client()->wallet_delegate_set_block_production(delegate_name, enabled);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_set_transaction_scanning_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (enabled)");
bool enabled = parameters[0].as<bool>();
bool result = get_client()->wallet_set_transaction_scanning(enabled);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_transaction_scanning_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("enabled"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'enabled'");
bool enabled = parameters["enabled"].as<bool>();
bool result = get_client()->wallet_set_transaction_scanning(enabled);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_sign_hash_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (signer)");
std::string signer = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (hash)");
fc::sha256 hash = parameters[1].as<fc::sha256>();
fc::ecc::compact_signature result = get_client()->wallet_sign_hash(signer, hash);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_sign_hash_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("signer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'signer'");
std::string signer = parameters["signer"].as<std::string>();
if (!parameters.contains("hash"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'hash'");
fc::sha256 hash = parameters["hash"].as<fc::sha256>();
fc::ecc::compact_signature result = get_client()->wallet_sign_hash(signer, hash);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_login_start_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (server_account)");
std::string server_account = parameters[0].as<std::string>();
std::string result = get_client()->wallet_login_start(server_account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_login_start_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("server_account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'server_account'");
std::string server_account = parameters["server_account"].as<std::string>();
std::string result = get_client()->wallet_login_start(server_account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_login_finish_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (server_key)");
TiValue::blockchain::PublicKeyType server_key = parameters[0].as<TiValue::blockchain::PublicKeyType>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (client_key)");
TiValue::blockchain::PublicKeyType client_key = parameters[1].as<TiValue::blockchain::PublicKeyType>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (client_signature)");
fc::ecc::compact_signature client_signature = parameters[2].as<fc::ecc::compact_signature>();
fc::variant result = get_client()->wallet_login_finish(server_key, client_key, client_signature);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_login_finish_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("server_key"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'server_key'");
TiValue::blockchain::PublicKeyType server_key = parameters["server_key"].as<TiValue::blockchain::PublicKeyType>();
if (!parameters.contains("client_key"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'client_key'");
TiValue::blockchain::PublicKeyType client_key = parameters["client_key"].as<TiValue::blockchain::PublicKeyType>();
if (!parameters.contains("client_signature"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'client_signature'");
fc::ecc::compact_signature client_signature = parameters["client_signature"].as<fc::ecc::compact_signature>();
fc::variant result = get_client()->wallet_login_finish(server_key, client_key, client_signature);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_balance_set_vote_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (balance_id)");
TiValue::blockchain::Address balance_id = parameters[0].as<TiValue::blockchain::Address>();
std::string voter_address = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
TiValue::wallet::VoteStrategy strategy = (parameters.size() <= 2) ?
(fc::json::from_string("\"vote_all\"").as<TiValue::wallet::VoteStrategy>()) :
parameters[2].as<TiValue::wallet::VoteStrategy>();
bool sign_and_broadcast = (parameters.size() <= 3) ?
(fc::json::from_string("\"true\"").as<bool>()) :
parameters[3].as<bool>();
std::string builder_path = (parameters.size() <= 4) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[4].as<std::string>();
TiValue::wallet::TransactionBuilder result = get_client()->wallet_balance_set_vote_info(balance_id, voter_address, strategy, sign_and_broadcast, builder_path);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_balance_set_vote_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("balance_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'balance_id'");
TiValue::blockchain::Address balance_id = parameters["balance_id"].as<TiValue::blockchain::Address>();
std::string voter_address = parameters.contains("voter_address") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["voter_address"].as<std::string>();
TiValue::wallet::VoteStrategy strategy = parameters.contains("strategy") ?
(fc::json::from_string("\"vote_all\"").as<TiValue::wallet::VoteStrategy>()) :
parameters["strategy"].as<TiValue::wallet::VoteStrategy>();
bool sign_and_broadcast = parameters.contains("sign_and_broadcast") ?
(fc::json::from_string("\"true\"").as<bool>()) :
parameters["sign_and_broadcast"].as<bool>();
std::string builder_path = parameters.contains("builder_path") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["builder_path"].as<std::string>();
TiValue::wallet::TransactionBuilder result = get_client()->wallet_balance_set_vote_info(balance_id, voter_address, strategy, sign_and_broadcast, builder_path);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_publish_slate_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (publishing_account_name)");
std::string publishing_account_name = parameters[0].as<std::string>();
std::string paying_account_name = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_publish_slate(publishing_account_name, paying_account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_publish_slate_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("publishing_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'publishing_account_name'");
std::string publishing_account_name = parameters["publishing_account_name"].as<std::string>();
std::string paying_account_name = parameters.contains("paying_account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["paying_account_name"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_publish_slate(publishing_account_name, paying_account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_publish_version_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (publishing_account_name)");
std::string publishing_account_name = parameters[0].as<std::string>();
std::string paying_account_name = (parameters.size() <= 1) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[1].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_publish_version(publishing_account_name, paying_account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_publish_version_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("publishing_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'publishing_account_name'");
std::string publishing_account_name = parameters["publishing_account_name"].as<std::string>();
std::string paying_account_name = parameters.contains("paying_account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["paying_account_name"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_publish_version(publishing_account_name, paying_account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_collect_genesis_balances_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_collect_genesis_balances(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_collect_genesis_balances_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_collect_genesis_balances(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_recover_accounts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (accounts_to_recover)");
int32_t accounts_to_recover = parameters[0].as<int32_t>();
int32_t maximum_number_of_attempts = (parameters.size() <= 1) ?
(fc::json::from_string("1000").as<int32_t>()) :
parameters[1].as<int32_t>();
int32_t result = get_client()->wallet_recover_accounts(accounts_to_recover, maximum_number_of_attempts);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_recover_accounts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("accounts_to_recover"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'accounts_to_recover'");
int32_t accounts_to_recover = parameters["accounts_to_recover"].as<int32_t>();
int32_t maximum_number_of_attempts = parameters.contains("maximum_number_of_attempts") ?
(fc::json::from_string("1000").as<int32_t>()) :
parameters["maximum_number_of_attempts"].as<int32_t>();
int32_t result = get_client()->wallet_recover_accounts(accounts_to_recover, maximum_number_of_attempts);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_verify_titan_deposit_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (transaction_id_prefix)");
std::string transaction_id_prefix = parameters[0].as<std::string>();
fc::optional<fc::variant_object> result = get_client()->wallet_verify_titan_deposit(transaction_id_prefix);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_verify_titan_deposit_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("transaction_id_prefix"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'transaction_id_prefix'");
std::string transaction_id_prefix = parameters["transaction_id_prefix"].as<std::string>();
fc::optional<fc::variant_object> result = get_client()->wallet_verify_titan_deposit(transaction_id_prefix);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_repair_entrys_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::string collecting_account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
get_client()->wallet_repair_entrys(collecting_account_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_repair_entrys_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::string collecting_account_name = parameters.contains("collecting_account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["collecting_account_name"].as<std::string>();
get_client()->wallet_repair_entrys(collecting_account_name);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_regenerate_keys_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (max_key_number)");
uint32_t max_key_number = parameters[1].as<uint32_t>();
int32_t result = get_client()->wallet_regenerate_keys(account_name, max_key_number);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_regenerate_keys_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
if (!parameters.contains("max_key_number"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'max_key_number'");
uint32_t max_key_number = parameters["max_key_number"].as<uint32_t>();
int32_t result = get_client()->wallet_regenerate_keys(account_name, max_key_number);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_retract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_to_retract)");
std::string account_to_retract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (pay_from_account)");
std::string pay_from_account = parameters[1].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_retract(account_to_retract, pay_from_account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_retract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_to_retract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_to_retract'");
std::string account_to_retract = parameters["account_to_retract"].as<std::string>();
if (!parameters.contains("pay_from_account"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'pay_from_account'");
std::string pay_from_account = parameters["pay_from_account"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_account_retract(account_to_retract, pay_from_account);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_delete_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
bool result = get_client()->wallet_account_delete(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_delete_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
bool result = get_client()->wallet_account_delete(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_address_rpc_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
std::string amount_to_transfer = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_address)");
std::string to_address = parameters[3].as<std::string>();
TiValue::blockchain::Imessage memo_message = (parameters.size() <= 4) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters[4].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = (parameters.size() <= 5) ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters[5].as<TiValue::wallet::VoteStrategy>();
std::string result = get_client()->wallet_transfer_to_address_rpc(amount_to_transfer, asset_symbol, from_account_name, to_address, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_address_rpc_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
std::string amount_to_transfer = parameters["amount_to_transfer"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_address'");
std::string to_address = parameters["to_address"].as<std::string>();
TiValue::blockchain::Imessage memo_message = parameters.contains("memo_message") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters["memo_message"].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = parameters.contains("strategy") ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters["strategy"].as<TiValue::wallet::VoteStrategy>();
std::string result = get_client()->wallet_transfer_to_address_rpc(amount_to_transfer, asset_symbol, from_account_name, to_address, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_balance_rpc_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
std::string result = get_client()->wallet_account_balance_rpc(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_account_balance_rpc_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
std::string result = get_client()->wallet_account_balance_rpc(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_public_account_rpc_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
std::string amount_to_transfer = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_account_name)");
std::string to_account_name = parameters[3].as<std::string>();
TiValue::blockchain::Imessage memo_message = (parameters.size() <= 4) ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters[4].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = (parameters.size() <= 5) ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters[5].as<TiValue::wallet::VoteStrategy>();
std::string result = get_client()->wallet_transfer_to_public_account_rpc(amount_to_transfer, asset_symbol, from_account_name, to_account_name, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_public_account_rpc_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
std::string amount_to_transfer = parameters["amount_to_transfer"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_account_name'");
std::string to_account_name = parameters["to_account_name"].as<std::string>();
TiValue::blockchain::Imessage memo_message = parameters.contains("memo_message") ?
(fc::json::from_string("\"\"").as<TiValue::blockchain::Imessage>()) :
parameters["memo_message"].as<TiValue::blockchain::Imessage>();
TiValue::wallet::VoteStrategy strategy = parameters.contains("strategy") ?
(fc::json::from_string("\"vote_recommended\"").as<TiValue::wallet::VoteStrategy>()) :
parameters["strategy"].as<TiValue::wallet::VoteStrategy>();
std::string result = get_client()->wallet_transfer_to_public_account_rpc(amount_to_transfer, asset_symbol, from_account_name, to_account_name, memo_message, strategy);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_account_owner_publickey_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (account_name)");
std::string account_name = parameters[0].as<std::string>();
TiValue::blockchain::PublicKeyType result = get_client()->wallet_get_account_owner_publickey(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_account_owner_publickey_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'account_name'");
std::string account_name = parameters["account_name"].as<std::string>();
TiValue::blockchain::PublicKeyType result = get_client()->wallet_get_account_owner_publickey(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
double amount_to_transfer = parameters[0].as<double>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_contract)");
std::string to_contract = parameters[3].as<std::string>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (amount_for_exec)");
double amount_for_exec = parameters[4].as<double>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_transfer_to_contract(amount_to_transfer, asset_symbol, from_account_name, to_contract, amount_for_exec);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
double amount_to_transfer = parameters["amount_to_transfer"].as<double>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_contract'");
std::string to_contract = parameters["to_contract"].as<std::string>();
if (!parameters.contains("amount_for_exec"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_for_exec'");
double amount_for_exec = parameters["amount_for_exec"].as<double>();
TiValue::wallet::WalletTransactionEntry result = get_client()->wallet_transfer_to_contract(amount_to_transfer, asset_symbol, from_account_name, to_contract, amount_for_exec);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
double amount_to_transfer = parameters[0].as<double>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_contract)");
std::string to_contract = parameters[3].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->wallet_transfer_to_contract_testing(amount_to_transfer, asset_symbol, from_account_name, to_contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_transfer_to_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
double amount_to_transfer = parameters["amount_to_transfer"].as<double>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_contract'");
std::string to_contract = parameters["to_contract"].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->wallet_transfer_to_contract_testing(amount_to_transfer, asset_symbol, from_account_name, to_contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_contracts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
vector<string> result = get_client()->wallet_get_contracts(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_contracts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
vector<string> result = get_client()->wallet_get_contracts(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_scan_contracts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->wallet_scan_contracts();
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_scan_contracts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->wallet_scan_contracts();
return fc::variant();
}
fc::variant CommonApiRpcServer::about_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
fc::variant_object result = get_client()->about();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::about_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
fc::variant_object result = get_client()->about();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
fc::variant_object result = get_client()->get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
fc::variant_object result = get_client()->get_info();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::stop_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
get_client()->stop();
return fc::variant();
}
fc::variant CommonApiRpcServer::stop_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
get_client()->stop();
return fc::variant();
}
fc::variant CommonApiRpcServer::help_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::string command_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
std::string result = get_client()->help(command_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::help_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::string command_name = parameters.contains("command_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["command_name"].as<std::string>();
std::string result = get_client()->help(command_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::validate_address_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (address)");
std::string address = parameters[0].as<std::string>();
fc::variant_object result = get_client()->validate_address(address);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::validate_address_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'address'");
std::string address = parameters["address"].as<std::string>();
fc::variant_object result = get_client()->validate_address(address);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::execute_command_line_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (input)");
std::string input = parameters[0].as<std::string>();
std::string result = get_client()->execute_command_line(input);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::execute_command_line_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("input"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'input'");
std::string input = parameters["input"].as<std::string>();
std::string result = get_client()->execute_command_line(input);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::execute_script_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (script)");
fc::path script = parameters[0].as<fc::path>();
get_client()->execute_script(script);
return fc::variant();
}
fc::variant CommonApiRpcServer::execute_script_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("script"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'script'");
fc::path script = parameters["script"].as<fc::path>();
get_client()->execute_script(script);
return fc::variant();
}
fc::variant CommonApiRpcServer::batch_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (method_name)");
std::string method_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (parameters_list)");
std::vector<fc::variants> parameters_list = parameters[1].as<std::vector<fc::variants>>();
fc::variants result = get_client()->batch(method_name, parameters_list);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::batch_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("method_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'method_name'");
std::string method_name = parameters["method_name"].as<std::string>();
if (!parameters.contains("parameters_list"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'parameters_list'");
std::vector<fc::variants> parameters_list = parameters["parameters_list"].as<std::vector<fc::variants>>();
fc::variants result = get_client()->batch(method_name, parameters_list);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::batch_authenticated_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (method_name)");
std::string method_name = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (parameters_list)");
std::vector<fc::variants> parameters_list = parameters[1].as<std::vector<fc::variants>>();
fc::variants result = get_client()->batch_authenticated(method_name, parameters_list);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::batch_authenticated_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
if (!parameters.contains("method_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'method_name'");
std::string method_name = parameters["method_name"].as<std::string>();
if (!parameters.contains("parameters_list"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'parameters_list'");
std::vector<fc::variants> parameters_list = parameters["parameters_list"].as<std::vector<fc::variants>>();
fc::variants result = get_client()->batch_authenticated(method_name, parameters_list);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::builder_finalize_and_sign_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (builder)");
TiValue::wallet::TransactionBuilder builder = parameters[0].as<TiValue::wallet::TransactionBuilder>();
TiValue::wallet::WalletTransactionEntry result = get_client()->builder_finalize_and_sign(builder);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::builder_finalize_and_sign_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("builder"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'builder'");
TiValue::wallet::TransactionBuilder builder = parameters["builder"].as<TiValue::wallet::TransactionBuilder>();
TiValue::wallet::WalletTransactionEntry result = get_client()->builder_finalize_and_sign(builder);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::meta_help_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
std::map<std::string, TiValue::api::MethodData> result = get_client()->meta_help();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::meta_help_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
std::map<std::string, TiValue::api::MethodData> result = get_client()->meta_help();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::rpc_set_username_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::string username = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
get_client()->rpc_set_username(username);
return fc::variant();
}
fc::variant CommonApiRpcServer::rpc_set_username_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::string username = parameters.contains("username") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["username"].as<std::string>();
get_client()->rpc_set_username(username);
return fc::variant();
}
fc::variant CommonApiRpcServer::rpc_set_password_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::string password = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
get_client()->rpc_set_password(password);
return fc::variant();
}
fc::variant CommonApiRpcServer::rpc_set_password_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
std::string password = parameters.contains("password") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["password"].as<std::string>();
get_client()->rpc_set_password(password);
return fc::variant();
}
fc::variant CommonApiRpcServer::rpc_start_server_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
uint32_t port = (parameters.size() <= 0) ?
(fc::json::from_string("\"65065\"").as<uint32_t>()) :
parameters[0].as<uint32_t>();
get_client()->rpc_start_server(port);
return fc::variant();
}
fc::variant CommonApiRpcServer::rpc_start_server_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
uint32_t port = parameters.contains("port") ?
(fc::json::from_string("\"65065\"").as<uint32_t>()) :
parameters["port"].as<uint32_t>();
get_client()->rpc_start_server(port);
return fc::variant();
}
fc::variant CommonApiRpcServer::http_start_server_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
uint32_t port = (parameters.size() <= 0) ?
(fc::json::from_string("\"65066\"").as<uint32_t>()) :
parameters[0].as<uint32_t>();
get_client()->http_start_server(port);
return fc::variant();
}
fc::variant CommonApiRpcServer::http_start_server_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
uint32_t port = parameters.contains("port") ?
(fc::json::from_string("\"65066\"").as<uint32_t>()) :
parameters["port"].as<uint32_t>();
get_client()->http_start_server(port);
return fc::variant();
}
fc::variant CommonApiRpcServer::ntp_update_time_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
get_client()->ntp_update_time();
return fc::variant();
}
fc::variant CommonApiRpcServer::ntp_update_time_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
get_client()->ntp_update_time();
return fc::variant();
}
fc::variant CommonApiRpcServer::disk_usage_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant result = get_client()->disk_usage();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::disk_usage_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
// done checking prerequisites
fc::variant result = get_client()->disk_usage();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::compile_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (filename)");
fc::path filename = parameters[0].as<fc::path>();
fc::path result = get_client()->compile_contract(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::compile_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'filename'");
fc::path filename = parameters["filename"].as<fc::path>();
fc::path result = get_client()->compile_contract(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::register_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (owner)");
std::string owner = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (codefile)");
fc::path codefile = parameters[1].as<fc::path>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (asset_symbol)");
std::string asset_symbol = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (init_limit)");
fc::optional<double> init_limit = parameters[3].as<fc::optional<double>>();
std::string result = get_client()->register_contract(owner, codefile, asset_symbol, init_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::register_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("owner"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'owner'");
std::string owner = parameters["owner"].as<std::string>();
if (!parameters.contains("codefile"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'codefile'");
fc::path codefile = parameters["codefile"].as<fc::path>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("init_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'init_limit'");
fc::optional<double> init_limit = parameters["init_limit"].as<fc::optional<double>>();
std::string result = get_client()->register_contract(owner, codefile, asset_symbol, init_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::register_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (owner)");
std::string owner = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (codefile)");
fc::path codefile = parameters[1].as<fc::path>();
std::vector<TiValue::blockchain::Asset> result = get_client()->register_contract_testing(owner, codefile);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::register_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("owner"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'owner'");
std::string owner = parameters["owner"].as<std::string>();
if (!parameters.contains("codefile"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'codefile'");
fc::path codefile = parameters["codefile"].as<fc::path>();
std::vector<TiValue::blockchain::Asset> result = get_client()->register_contract_testing(owner, codefile);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::upgrade_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (upgrader_name)");
std::string upgrader_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (new_contract_name)");
std::string new_contract_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (new_contract_desc)");
TiValue::blockchain::Imessage new_contract_desc = parameters[3].as<TiValue::blockchain::Imessage>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (asset_symbol)");
std::string asset_symbol = parameters[4].as<std::string>();
if (parameters.size() <= 5)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 6 (exec_limit)");
fc::optional<double> exec_limit = parameters[5].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->upgrade_contract(contract_address, upgrader_name, new_contract_name, new_contract_desc, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::upgrade_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("upgrader_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'upgrader_name'");
std::string upgrader_name = parameters["upgrader_name"].as<std::string>();
if (!parameters.contains("new_contract_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_name'");
std::string new_contract_name = parameters["new_contract_name"].as<std::string>();
if (!parameters.contains("new_contract_desc"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_desc'");
TiValue::blockchain::Imessage new_contract_desc = parameters["new_contract_desc"].as<TiValue::blockchain::Imessage>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("exec_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'exec_limit'");
fc::optional<double> exec_limit = parameters["exec_limit"].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->upgrade_contract(contract_address, upgrader_name, new_contract_name, new_contract_desc, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::upgrade_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (upgrader_name)");
std::string upgrader_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (new_contract_name)");
std::string new_contract_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (new_contract_desc)");
TiValue::blockchain::Imessage new_contract_desc = parameters[3].as<TiValue::blockchain::Imessage>();
std::vector<TiValue::blockchain::Asset> result = get_client()->upgrade_contract_testing(contract_address, upgrader_name, new_contract_name, new_contract_desc);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::upgrade_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("upgrader_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'upgrader_name'");
std::string upgrader_name = parameters["upgrader_name"].as<std::string>();
if (!parameters.contains("new_contract_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_name'");
std::string new_contract_name = parameters["new_contract_name"].as<std::string>();
if (!parameters.contains("new_contract_desc"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_desc'");
TiValue::blockchain::Imessage new_contract_desc = parameters["new_contract_desc"].as<TiValue::blockchain::Imessage>();
std::vector<TiValue::blockchain::Asset> result = get_client()->upgrade_contract_testing(contract_address, upgrader_name, new_contract_name, new_contract_desc);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::destroy_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (destroyer_name)");
std::string destroyer_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (asset_symbol)");
std::string asset_symbol = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (exec_limit)");
fc::optional<double> exec_limit = parameters[3].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->destroy_contract(contract_address, destroyer_name, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::destroy_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("destroyer_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'destroyer_name'");
std::string destroyer_name = parameters["destroyer_name"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("exec_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'exec_limit'");
fc::optional<double> exec_limit = parameters["exec_limit"].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->destroy_contract(contract_address, destroyer_name, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::destroy_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (destroyer_name)");
std::string destroyer_name = parameters[1].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->destroy_contract_testing(contract_address, destroyer_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::destroy_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("destroyer_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'destroyer_name'");
std::string destroyer_name = parameters["destroyer_name"].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->destroy_contract_testing(contract_address, destroyer_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::call_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (caller_name)");
std::string caller_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (function_name)");
std::string function_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (params)");
std::string params = parameters[3].as<std::string>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (asset_symbol)");
std::string asset_symbol = parameters[4].as<std::string>();
if (parameters.size() <= 5)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 6 (call_limit)");
fc::optional<double> call_limit = parameters[5].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->call_contract(contract, caller_name, function_name, params, asset_symbol, call_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::call_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("caller_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'caller_name'");
std::string caller_name = parameters["caller_name"].as<std::string>();
if (!parameters.contains("function_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'function_name'");
std::string function_name = parameters["function_name"].as<std::string>();
if (!parameters.contains("params"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'params'");
std::string params = parameters["params"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("call_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'call_limit'");
fc::optional<double> call_limit = parameters["call_limit"].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->call_contract(contract, caller_name, function_name, params, asset_symbol, call_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->get_contract_info(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->get_contract_info(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
std::vector<TiValue::blockchain::BalanceEntry> result = get_client()->get_contract_balance(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
std::vector<TiValue::blockchain::BalanceEntry> result = get_client()->get_contract_balance(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::call_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (caller_name)");
std::string caller_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (function_name)");
std::string function_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (params)");
std::string params = parameters[3].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->call_contract_testing(contract, caller_name, function_name, params);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::call_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("caller_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'caller_name'");
std::string caller_name = parameters["caller_name"].as<std::string>();
if (!parameters.contains("function_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'function_name'");
std::string function_name = parameters["function_name"].as<std::string>();
if (!parameters.contains("params"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'params'");
std::string params = parameters["params"].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->call_contract_testing(contract, caller_name, function_name, params);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::call_contract_offline_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (caller_name)");
std::string caller_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (function_name)");
std::string function_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (params)");
std::string params = parameters[3].as<std::string>();
std::string result = get_client()->call_contract_offline(contract, caller_name, function_name, params);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::call_contract_offline_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("caller_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'caller_name'");
std::string caller_name = parameters["caller_name"].as<std::string>();
if (!parameters.contains("function_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'function_name'");
std::string function_name = parameters["function_name"].as<std::string>();
if (!parameters.contains("params"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'params'");
std::string params = parameters["params"].as<std::string>();
std::string result = get_client()->call_contract_offline(contract, caller_name, function_name, params);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::load_contract_to_file_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (file)");
fc::path file = parameters[1].as<fc::path>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->load_contract_to_file(contract, file);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::load_contract_to_file_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("file"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file'");
fc::path file = parameters["file"].as<fc::path>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->load_contract_to_file(contract, file);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_result_trx_id_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (request_id)");
TiValue::blockchain::TransactionIdType request_id = parameters[0].as<TiValue::blockchain::TransactionIdType>();
TiValue::blockchain::TransactionIdType result = get_client()->get_result_trx_id(request_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_result_trx_id_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("request_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'request_id'");
TiValue::blockchain::TransactionIdType request_id = parameters["request_id"].as<TiValue::blockchain::TransactionIdType>();
TiValue::blockchain::TransactionIdType result = get_client()->get_result_trx_id(request_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_request_trx_id_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (request_id)");
TiValue::blockchain::TransactionIdType request_id = parameters[0].as<TiValue::blockchain::TransactionIdType>();
TiValue::blockchain::TransactionIdType result = get_client()->get_request_trx_id(request_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_request_trx_id_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("request_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'request_id'");
TiValue::blockchain::TransactionIdType request_id = parameters["request_id"].as<TiValue::blockchain::TransactionIdType>();
TiValue::blockchain::TransactionIdType result = get_client()->get_request_trx_id(request_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_open_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->sandbox_open();
return fc::variant();
}
fc::variant CommonApiRpcServer::sandbox_open_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->sandbox_open();
return fc::variant();
}
fc::variant CommonApiRpcServer::sandbox_close_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->sandbox_close();
return fc::variant();
}
fc::variant CommonApiRpcServer::sandbox_close_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
get_client()->sandbox_close();
return fc::variant();
}
fc::variant CommonApiRpcServer::sandbox_register_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (owner)");
std::string owner = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (codefile)");
fc::path codefile = parameters[1].as<fc::path>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (asset_symbol)");
std::string asset_symbol = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (initLimit)");
fc::optional<double> initLimit = parameters[3].as<fc::optional<double>>();
std::string result = get_client()->sandbox_register_contract(owner, codefile, asset_symbol, initLimit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_register_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("owner"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'owner'");
std::string owner = parameters["owner"].as<std::string>();
if (!parameters.contains("codefile"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'codefile'");
fc::path codefile = parameters["codefile"].as<fc::path>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("initLimit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'initLimit'");
fc::optional<double> initLimit = parameters["initLimit"].as<fc::optional<double>>();
std::string result = get_client()->sandbox_register_contract(owner, codefile, asset_symbol, initLimit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_call_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (caller_name)");
std::string caller_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (function_name)");
std::string function_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (params)");
std::string params = parameters[3].as<std::string>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (cost_asset)");
std::string cost_asset = parameters[4].as<std::string>();
if (parameters.size() <= 5)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 6 (callLimit)");
fc::optional<double> callLimit = parameters[5].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_call_contract(contract, caller_name, function_name, params, cost_asset, callLimit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_call_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("caller_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'caller_name'");
std::string caller_name = parameters["caller_name"].as<std::string>();
if (!parameters.contains("function_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'function_name'");
std::string function_name = parameters["function_name"].as<std::string>();
if (!parameters.contains("params"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'params'");
std::string params = parameters["params"].as<std::string>();
if (!parameters.contains("cost_asset"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'cost_asset'");
std::string cost_asset = parameters["cost_asset"].as<std::string>();
if (!parameters.contains("callLimit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'callLimit'");
fc::optional<double> callLimit = parameters["callLimit"].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_call_contract(contract, caller_name, function_name, params, cost_asset, callLimit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_upgrade_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (upgrader_name)");
std::string upgrader_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (new_contract_name)");
std::string new_contract_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (new_contract_desc)");
TiValue::blockchain::Imessage new_contract_desc = parameters[3].as<TiValue::blockchain::Imessage>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (asset_symbol)");
std::string asset_symbol = parameters[4].as<std::string>();
if (parameters.size() <= 5)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 6 (exec_limit)");
fc::optional<double> exec_limit = parameters[5].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_upgrade_contract(contract_address, upgrader_name, new_contract_name, new_contract_desc, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_upgrade_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("upgrader_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'upgrader_name'");
std::string upgrader_name = parameters["upgrader_name"].as<std::string>();
if (!parameters.contains("new_contract_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_name'");
std::string new_contract_name = parameters["new_contract_name"].as<std::string>();
if (!parameters.contains("new_contract_desc"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_desc'");
TiValue::blockchain::Imessage new_contract_desc = parameters["new_contract_desc"].as<TiValue::blockchain::Imessage>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("exec_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'exec_limit'");
fc::optional<double> exec_limit = parameters["exec_limit"].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_upgrade_contract(contract_address, upgrader_name, new_contract_name, new_contract_desc, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_upgrade_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (upgrader_name)");
std::string upgrader_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (new_contract_name)");
std::string new_contract_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (new_contract_desc)");
TiValue::blockchain::Imessage new_contract_desc = parameters[3].as<TiValue::blockchain::Imessage>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_upgrade_contract_testing(contract_address, upgrader_name, new_contract_name, new_contract_desc);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_upgrade_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("upgrader_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'upgrader_name'");
std::string upgrader_name = parameters["upgrader_name"].as<std::string>();
if (!parameters.contains("new_contract_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_name'");
std::string new_contract_name = parameters["new_contract_name"].as<std::string>();
if (!parameters.contains("new_contract_desc"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'new_contract_desc'");
TiValue::blockchain::Imessage new_contract_desc = parameters["new_contract_desc"].as<TiValue::blockchain::Imessage>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_upgrade_contract_testing(contract_address, upgrader_name, new_contract_name, new_contract_desc);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_destroy_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (destroyer_name)");
std::string destroyer_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (asset_symbol)");
std::string asset_symbol = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (exec_limit)");
fc::optional<double> exec_limit = parameters[3].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_destroy_contract(contract_address, destroyer_name, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_destroy_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("destroyer_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'destroyer_name'");
std::string destroyer_name = parameters["destroyer_name"].as<std::string>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("exec_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'exec_limit'");
fc::optional<double> exec_limit = parameters["exec_limit"].as<fc::optional<double>>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_destroy_contract(contract_address, destroyer_name, asset_symbol, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_destroy_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_address)");
std::string contract_address = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (destroyer_name)");
std::string destroyer_name = parameters[1].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_destroy_contract_testing(contract_address, destroyer_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_destroy_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract_address"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_address'");
std::string contract_address = parameters["contract_address"].as<std::string>();
if (!parameters.contains("destroyer_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'destroyer_name'");
std::string destroyer_name = parameters["destroyer_name"].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_destroy_contract_testing(contract_address, destroyer_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_get_contract_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->sandbox_get_contract_info(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_get_contract_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->sandbox_get_contract_info(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_get_contract_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
std::vector<TiValue::blockchain::BalanceEntry> result = get_client()->sandbox_get_contract_balance(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_get_contract_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
std::vector<TiValue::blockchain::BalanceEntry> result = get_client()->sandbox_get_contract_balance(contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_transfer_to_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
double amount_to_transfer = parameters[0].as<double>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_contract)");
std::string to_contract = parameters[3].as<std::string>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (amount_for_exec)");
double amount_for_exec = parameters[4].as<double>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_transfer_to_contract(amount_to_transfer, asset_symbol, from_account_name, to_contract, amount_for_exec);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_transfer_to_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
double amount_to_transfer = parameters["amount_to_transfer"].as<double>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_contract'");
std::string to_contract = parameters["to_contract"].as<std::string>();
if (!parameters.contains("amount_for_exec"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_for_exec'");
double amount_for_exec = parameters["amount_for_exec"].as<double>();
TiValue::wallet::WalletTransactionEntry result = get_client()->sandbox_transfer_to_contract(amount_to_transfer, asset_symbol, from_account_name, to_contract, amount_for_exec);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_account_balance_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->sandbox_account_balance(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_account_balance_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
TiValue::wallet::AccountBalanceSummaryType result = get_client()->sandbox_account_balance(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_compile_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (filename)");
fc::path filename = parameters[0].as<fc::path>();
fc::path result = get_client()->sandbox_compile_contract(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_compile_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'filename'");
fc::path filename = parameters["filename"].as<fc::path>();
fc::path result = get_client()->sandbox_compile_contract(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_load_contract_to_file_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (file)");
fc::path file = parameters[1].as<fc::path>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->sandbox_load_contract_to_file(contract, file);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_load_contract_to_file_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("file"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file'");
fc::path file = parameters["file"].as<fc::path>();
TiValue::blockchain::ContractEntryPrintable result = get_client()->sandbox_load_contract_to_file(contract, file);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_register_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (owner)");
std::string owner = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (codefile)");
fc::path codefile = parameters[1].as<fc::path>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_register_contract_testing(owner, codefile);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_register_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("owner"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'owner'");
std::string owner = parameters["owner"].as<std::string>();
if (!parameters.contains("codefile"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'codefile'");
fc::path codefile = parameters["codefile"].as<fc::path>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_register_contract_testing(owner, codefile);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_call_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract)");
std::string contract = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (caller_name)");
std::string caller_name = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (function_name)");
std::string function_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (params)");
std::string params = parameters[3].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_call_contract_testing(contract, caller_name, function_name, params);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_call_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract'");
std::string contract = parameters["contract"].as<std::string>();
if (!parameters.contains("caller_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'caller_name'");
std::string caller_name = parameters["caller_name"].as<std::string>();
if (!parameters.contains("function_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'function_name'");
std::string function_name = parameters["function_name"].as<std::string>();
if (!parameters.contains("params"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'params'");
std::string params = parameters["params"].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_call_contract_testing(contract, caller_name, function_name, params);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_transfer_to_contract_testing_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (amount_to_transfer)");
double amount_to_transfer = parameters[0].as<double>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (asset_symbol)");
std::string asset_symbol = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (from_account_name)");
std::string from_account_name = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (to_contract)");
std::string to_contract = parameters[3].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_transfer_to_contract_testing(amount_to_transfer, asset_symbol, from_account_name, to_contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_transfer_to_contract_testing_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
if (!parameters.contains("amount_to_transfer"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'amount_to_transfer'");
double amount_to_transfer = parameters["amount_to_transfer"].as<double>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("from_account_name"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'from_account_name'");
std::string from_account_name = parameters["from_account_name"].as<std::string>();
if (!parameters.contains("to_contract"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'to_contract'");
std::string to_contract = parameters["to_contract"].as<std::string>();
std::vector<TiValue::blockchain::Asset> result = get_client()->sandbox_transfer_to_contract_testing(amount_to_transfer, asset_symbol, from_account_name, to_contract);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_list_my_addresses_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
std::string account_name = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
vector<TiValue::blockchain::SandboxAccountInfo> result = get_client()->sandbox_list_my_addresses(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::sandbox_list_my_addresses_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
verify_sandbox_is_open();
// done checking prerequisites
std::string account_name = parameters.contains("account_name") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["account_name"].as<std::string>();
vector<TiValue::blockchain::SandboxAccountInfo> result = get_client()->sandbox_list_my_addresses(account_name);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_registered_in_transaction_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (trx_id)");
TiValue::blockchain::TransactionIdType trx_id = parameters[0].as<TiValue::blockchain::TransactionIdType>();
std::string result = get_client()->get_contract_registered_in_transaction(trx_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_registered_in_transaction_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("trx_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'trx_id'");
TiValue::blockchain::TransactionIdType trx_id = parameters["trx_id"].as<TiValue::blockchain::TransactionIdType>();
std::string result = get_client()->get_contract_registered_in_transaction(trx_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_transaction_id_contract_registered_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_id)");
std::string contract_id = parameters[0].as<std::string>();
TiValue::blockchain::TransactionIdType result = get_client()->get_transaction_id_contract_registered(contract_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_transaction_id_contract_registered_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("contract_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_id'");
std::string contract_id = parameters["contract_id"].as<std::string>();
TiValue::blockchain::TransactionIdType result = get_client()->get_transaction_id_contract_registered(contract_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_info_from_gpc_file_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (file)");
fc::path file = parameters[0].as<fc::path>();
TiValue::blockchain::CodePrintAble result = get_client()->get_contract_info_from_gpc_file(file);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_contract_info_from_gpc_file_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("file"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file'");
fc::path file = parameters["file"].as<fc::path>();
TiValue::blockchain::CodePrintAble result = get_client()->get_contract_info_from_gpc_file(file);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::compile_script_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// this method has no prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (filename)");
fc::path filename = parameters[0].as<fc::path>();
fc::path result = get_client()->compile_script(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::compile_script_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// this method has no prerequisites
if (!parameters.contains("filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'filename'");
fc::path filename = parameters["filename"].as<fc::path>();
fc::path result = get_client()->compile_script(filename);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::add_script_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (filename)");
fc::path filename = parameters[0].as<fc::path>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (description)");
TiValue::blockchain::Imessage description = parameters[1].as<TiValue::blockchain::Imessage>();
std::string result = get_client()->add_script(filename, description);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::add_script_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("filename"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'filename'");
fc::path filename = parameters["filename"].as<fc::path>();
if (!parameters.contains("description"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'description'");
TiValue::blockchain::Imessage description = parameters["description"].as<TiValue::blockchain::Imessage>();
std::string result = get_client()->add_script(filename, description);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::remove_script_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (scriptid)");
std::string scriptid = parameters[0].as<std::string>();
get_client()->remove_script(scriptid);
return fc::variant();
}
fc::variant CommonApiRpcServer::remove_script_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("scriptid"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'scriptid'");
std::string scriptid = parameters["scriptid"].as<std::string>();
get_client()->remove_script(scriptid);
return fc::variant();
}
fc::variant CommonApiRpcServer::get_script_info_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (scriptid)");
std::string scriptid = parameters[0].as<std::string>();
TiValue::wallet::ScriptEntryPrintable result = get_client()->get_script_info(scriptid);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_script_info_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("scriptid"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'scriptid'");
std::string scriptid = parameters["scriptid"].as<std::string>();
TiValue::wallet::ScriptEntryPrintable result = get_client()->get_script_info(scriptid);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::list_scripts_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::wallet::ScriptEntryPrintable> result = get_client()->list_scripts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::list_scripts_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::wallet::ScriptEntryPrintable> result = get_client()->list_scripts();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::disable_script_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (scriptid)");
std::string scriptid = parameters[0].as<std::string>();
get_client()->disable_script(scriptid);
return fc::variant();
}
fc::variant CommonApiRpcServer::disable_script_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("scriptid"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'scriptid'");
std::string scriptid = parameters["scriptid"].as<std::string>();
get_client()->disable_script(scriptid);
return fc::variant();
}
fc::variant CommonApiRpcServer::enable_script_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (scriptid)");
std::string scriptid = parameters[0].as<std::string>();
get_client()->enable_script(scriptid);
return fc::variant();
}
fc::variant CommonApiRpcServer::enable_script_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("scriptid"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'scriptid'");
std::string scriptid = parameters["scriptid"].as<std::string>();
get_client()->enable_script(scriptid);
return fc::variant();
}
fc::variant CommonApiRpcServer::import_script_db_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (dbfile)");
fc::path dbfile = parameters[0].as<fc::path>();
get_client()->import_script_db(dbfile);
return fc::variant();
}
fc::variant CommonApiRpcServer::import_script_db_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("dbfile"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'dbfile'");
fc::path dbfile = parameters["dbfile"].as<fc::path>();
get_client()->import_script_db(dbfile);
return fc::variant();
}
fc::variant CommonApiRpcServer::export_script_db_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (dbfile)");
fc::path dbfile = parameters[0].as<fc::path>();
get_client()->export_script_db(dbfile);
return fc::variant();
}
fc::variant CommonApiRpcServer::export_script_db_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("dbfile"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'dbfile'");
fc::path dbfile = parameters["dbfile"].as<fc::path>();
get_client()->export_script_db(dbfile);
return fc::variant();
}
fc::variant CommonApiRpcServer::get_events_bound_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (script_id)");
std::string script_id = parameters[0].as<std::string>();
std::vector<std::string> result = get_client()->get_events_bound(script_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_events_bound_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("script_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'script_id'");
std::string script_id = parameters["script_id"].as<std::string>();
std::vector<std::string> result = get_client()->get_events_bound(script_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::list_event_handler_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_id_str)");
std::string contract_id_str = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (event_type)");
std::string event_type = parameters[1].as<std::string>();
std::vector<std::string> result = get_client()->list_event_handler(contract_id_str, event_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::list_event_handler_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_id_str"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_id_str'");
std::string contract_id_str = parameters["contract_id_str"].as<std::string>();
if (!parameters.contains("event_type"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'event_type'");
std::string event_type = parameters["event_type"].as<std::string>();
std::vector<std::string> result = get_client()->list_event_handler(contract_id_str, event_type);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::add_event_handler_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_id_str)");
std::string contract_id_str = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (event_type)");
std::string event_type = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (script_id)");
std::string script_id = parameters[2].as<std::string>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (index)");
uint32_t index = parameters[3].as<uint32_t>();
get_client()->add_event_handler(contract_id_str, event_type, script_id, index);
return fc::variant();
}
fc::variant CommonApiRpcServer::add_event_handler_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_id_str"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_id_str'");
std::string contract_id_str = parameters["contract_id_str"].as<std::string>();
if (!parameters.contains("event_type"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'event_type'");
std::string event_type = parameters["event_type"].as<std::string>();
if (!parameters.contains("script_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'script_id'");
std::string script_id = parameters["script_id"].as<std::string>();
if (!parameters.contains("index"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'index'");
uint32_t index = parameters["index"].as<uint32_t>();
get_client()->add_event_handler(contract_id_str, event_type, script_id, index);
return fc::variant();
}
fc::variant CommonApiRpcServer::delete_event_handler_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (contract_id_str)");
std::string contract_id_str = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (event_type)");
std::string event_type = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (script_id)");
std::string script_id = parameters[2].as<std::string>();
get_client()->delete_event_handler(contract_id_str, event_type, script_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::delete_event_handler_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("contract_id_str"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'contract_id_str'");
std::string contract_id_str = parameters["contract_id_str"].as<std::string>();
if (!parameters.contains("event_type"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'event_type'");
std::string event_type = parameters["event_type"].as<std::string>();
if (!parameters.contains("script_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'script_id'");
std::string script_id = parameters["script_id"].as<std::string>();
get_client()->delete_event_handler(contract_id_str, event_type, script_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::store_file_to_network_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (owner)");
std::string owner = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (AuthorizatingContractId)");
std::string AuthorizatingContractId = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (file)");
TiValue::blockchain::FilePath file = parameters[2].as<TiValue::blockchain::FilePath>();
if (parameters.size() <= 3)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 4 (asset_symbol)");
std::string asset_symbol = parameters[3].as<std::string>();
if (parameters.size() <= 4)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 5 (price)");
double price = parameters[4].as<double>();
if (parameters.size() <= 5)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 6 (numofcopy)");
uint32_t numofcopy = parameters[5].as<uint32_t>();
if (parameters.size() <= 6)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 7 (numofpiece)");
uint32_t numofpiece = parameters[6].as<uint32_t>();
if (parameters.size() <= 7)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 8 (payterm)");
uint32_t payterm = parameters[7].as<uint32_t>();
if (parameters.size() <= 8)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 9 (exec_limit)");
double exec_limit = parameters[8].as<double>();
TiValue::blockchain::UploadRequestEntry result = get_client()->store_file_to_network(owner, AuthorizatingContractId, file, asset_symbol, price, numofcopy, numofpiece, payterm, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::store_file_to_network_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("owner"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'owner'");
std::string owner = parameters["owner"].as<std::string>();
if (!parameters.contains("AuthorizatingContractId"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'AuthorizatingContractId'");
std::string AuthorizatingContractId = parameters["AuthorizatingContractId"].as<std::string>();
if (!parameters.contains("file"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file'");
TiValue::blockchain::FilePath file = parameters["file"].as<TiValue::blockchain::FilePath>();
if (!parameters.contains("asset_symbol"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'asset_symbol'");
std::string asset_symbol = parameters["asset_symbol"].as<std::string>();
if (!parameters.contains("price"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'price'");
double price = parameters["price"].as<double>();
if (!parameters.contains("numofcopy"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'numofcopy'");
uint32_t numofcopy = parameters["numofcopy"].as<uint32_t>();
if (!parameters.contains("numofpiece"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'numofpiece'");
uint32_t numofpiece = parameters["numofpiece"].as<uint32_t>();
if (!parameters.contains("payterm"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'payterm'");
uint32_t payterm = parameters["payterm"].as<uint32_t>();
if (!parameters.contains("exec_limit"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'exec_limit'");
double exec_limit = parameters["exec_limit"].as<double>();
TiValue::blockchain::UploadRequestEntry result = get_client()->store_file_to_network(owner, AuthorizatingContractId, file, asset_symbol, price, numofcopy, numofpiece, payterm, exec_limit);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_file_access_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (file_id)");
std::string file_id = parameters[0].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->get_file_access(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::get_file_access_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("file_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_id'");
std::string file_id = parameters["file_id"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->get_file_access(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::store_file_piece_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (file_id)");
std::string file_id = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (file_piece_id)");
std::string file_piece_id = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (beneficiary)");
std::string beneficiary = parameters[2].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->store_file_piece(file_id, file_piece_id, beneficiary);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::store_file_piece_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("file_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_id'");
std::string file_id = parameters["file_id"].as<std::string>();
if (!parameters.contains("file_piece_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_piece_id'");
std::string file_piece_id = parameters["file_piece_id"].as<std::string>();
if (!parameters.contains("beneficiary"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'beneficiary'");
std::string beneficiary = parameters["beneficiary"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->store_file_piece(file_id, file_piece_id, beneficiary);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::store_reject_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (file_id)");
std::string file_id = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (file_piece_id)");
std::string file_piece_id = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (node_id)");
std::string node_id = parameters[2].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->store_reject(file_id, file_piece_id, node_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::store_reject_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("file_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_id'");
std::string file_id = parameters["file_id"].as<std::string>();
if (!parameters.contains("file_piece_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_piece_id'");
std::string file_piece_id = parameters["file_piece_id"].as<std::string>();
if (!parameters.contains("node_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'node_id'");
std::string node_id = parameters["node_id"].as<std::string>();
TiValue::wallet::WalletTransactionEntry result = get_client()->store_reject(file_id, file_piece_id, node_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_set_node_id_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (node_id)");
std::string node_id = parameters[0].as<std::string>();
get_client()->wallet_set_node_id(node_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::wallet_set_node_id_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("node_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'node_id'");
std::string node_id = parameters["node_id"].as<std::string>();
get_client()->wallet_set_node_id(node_id);
return fc::variant();
}
fc::variant CommonApiRpcServer::blockchain_list_file_saved_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<std::string> result = get_client()->blockchain_list_file_saved();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_list_file_saved_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<std::string> result = get_client()->blockchain_list_file_saved();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_file_authorizing_contract_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (file_id)");
std::string file_id = parameters[0].as<std::string>();
std::string result = get_client()->blockchain_get_file_authorizing_contract(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_file_authorizing_contract_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("file_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_id'");
std::string file_id = parameters["file_id"].as<std::string>();
std::string result = get_client()->blockchain_get_file_authorizing_contract(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_store_request_for_my_file_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::string file_id = (parameters.size() <= 0) ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters[0].as<std::string>();
std::vector<TiValue::blockchain::StoreRequestInfo> result = get_client()->wallet_list_store_request_for_my_file(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_list_store_request_for_my_file_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::string file_id = parameters.contains("file_id") ?
(fc::json::from_string("\"\"").as<std::string>()) :
parameters["file_id"].as<std::string>();
std::vector<TiValue::blockchain::StoreRequestInfo> result = get_client()->wallet_list_store_request_for_my_file(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_check_signature_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (origin_data)");
std::string origin_data = parameters[0].as<std::string>();
if (parameters.size() <= 1)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 2 (signature)");
std::string signature = parameters[1].as<std::string>();
if (parameters.size() <= 2)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 3 (key)");
std::string key = parameters[2].as<std::string>();
bool result = get_client()->blockchain_check_signature(origin_data, signature, key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_check_signature_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("origin_data"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'origin_data'");
std::string origin_data = parameters["origin_data"].as<std::string>();
if (!parameters.contains("signature"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'signature'");
std::string signature = parameters["signature"].as<std::string>();
if (!parameters.contains("key"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'key'");
std::string key = parameters["key"].as<std::string>();
bool result = get_client()->blockchain_check_signature(origin_data, signature, key);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_access_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::blockchain::FileAccessInfo> result = get_client()->wallet_get_my_access();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_access_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::blockchain::FileAccessInfo> result = get_client()->wallet_get_my_access();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_upload_requests_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::blockchain::UploadRequestEntry> result = get_client()->wallet_get_my_upload_requests();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_upload_requests_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::blockchain::UploadRequestEntry> result = get_client()->wallet_get_my_upload_requests();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_store_request_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
vector<string> result = get_client()->wallet_get_my_store_request();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_store_request_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
vector<string> result = get_client()->wallet_get_my_store_request();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_store_confirmed_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
vector<string> result = get_client()->wallet_get_my_store_confirmed();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_store_confirmed_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
vector<string> result = get_client()->wallet_get_my_store_confirmed();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_store_rejected_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::blockchain::FilePieceInfo> result = get_client()->wallet_get_my_store_rejected();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::wallet_get_my_store_rejected_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
std::vector<TiValue::blockchain::FilePieceInfo> result = get_client()->wallet_get_my_store_rejected();
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_file_save_node_positional(fc::rpc::json_connection* json_connection, const fc::variants& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (parameters.size() <= 0)
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 1 (file_id)");
std::string file_id = parameters[0].as<std::string>();
TiValue::blockchain::FileSaveInfo result = get_client()->blockchain_get_file_save_node(file_id);
return fc::variant(result);
}
fc::variant CommonApiRpcServer::blockchain_get_file_save_node_named(fc::rpc::json_connection* json_connection, const fc::variant_object& parameters)
{
// check all of this method's prerequisites
verify_json_connection_is_authenticated(json_connection);
verify_wallet_is_open();
verify_wallet_is_unlocked();
// done checking prerequisites
if (!parameters.contains("file_id"))
FC_THROW_EXCEPTION(fc::invalid_arg_exception, "missing required parameter 'file_id'");
std::string file_id = parameters["file_id"].as<std::string>();
TiValue::blockchain::FileSaveInfo result = get_client()->blockchain_get_file_save_node(file_id);
return fc::variant(result);
}
void CommonApiRpcServer::register_CommonApi_methods(const fc::rpc::json_connection_ptr& json_connection)
{
fc::rpc::json_connection::method bound_positional_method;
fc::rpc::json_connection::named_param_method bound_named_method;
auto capture_con = json_connection.get();
// register method blockchain_get_info
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_info_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_info", bound_positional_method);
json_connection->add_method("getconfig", bound_positional_method);
json_connection->add_method("get_config", bound_positional_method);
json_connection->add_method("config", bound_positional_method);
json_connection->add_method("blockchain_get_config", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_info", bound_named_method);
json_connection->add_named_param_method("getconfig", bound_named_method);
json_connection->add_named_param_method("get_config", bound_named_method);
json_connection->add_named_param_method("config", bound_named_method);
json_connection->add_named_param_method("blockchain_get_config", bound_named_method);
// register method blockchain_generate_snapshot
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_generate_snapshot_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_generate_snapshot", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_generate_snapshot_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_generate_snapshot", bound_named_method);
// register method blockchain_get_alp_account_balance_entry
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_alp_account_balance_entry_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_alp_account_balance_entry", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_alp_account_balance_entry_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_alp_account_balance_entry", bound_named_method);
// register method blockchain_generate_issuance_map
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_generate_issuance_map_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_generate_issuance_map", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_generate_issuance_map_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_generate_issuance_map", bound_named_method);
// register method blockchain_calculate_supply
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_calculate_supply_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_calculate_supply", bound_positional_method);
json_connection->add_method("supply", bound_positional_method);
json_connection->add_method("calculate_supply", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_calculate_supply_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_calculate_supply", bound_named_method);
json_connection->add_named_param_method("supply", bound_named_method);
json_connection->add_named_param_method("calculate_supply", bound_named_method);
// register method blockchain_is_synced
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_is_synced_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_is_synced", bound_positional_method);
json_connection->add_method("synced", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_is_synced_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_is_synced", bound_named_method);
json_connection->add_named_param_method("synced", bound_named_method);
// register method blockchain_get_block_count
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_count_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_block_count", bound_positional_method);
json_connection->add_method("blockchain_get_blockcount", bound_positional_method);
json_connection->add_method("getblockcount", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_count_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_block_count", bound_named_method);
json_connection->add_named_param_method("blockchain_get_blockcount", bound_named_method);
json_connection->add_named_param_method("getblockcount", bound_named_method);
// register method blockchain_get_security_state
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_security_state_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_security_state", bound_positional_method);
json_connection->add_method("alert_state", bound_positional_method);
json_connection->add_method("security_state", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_security_state_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_security_state", bound_named_method);
json_connection->add_named_param_method("alert_state", bound_named_method);
json_connection->add_named_param_method("security_state", bound_named_method);
// register method blockchain_list_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_accounts_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_accounts", bound_named_method);
// register method blockchain_list_recently_updated_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_recently_updated_accounts_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_recently_updated_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_recently_updated_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_recently_updated_accounts", bound_named_method);
// register method blockchain_list_recently_registered_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_recently_registered_accounts_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_recently_registered_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_recently_registered_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_recently_registered_accounts", bound_named_method);
// register method blockchain_list_assets
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_assets_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_assets", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_assets_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_assets", bound_named_method);
// register method blockchain_list_pending_transactions
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_pending_transactions_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_pending_transactions", bound_positional_method);
json_connection->add_method("blockchain_get_pending_transactions", bound_positional_method);
json_connection->add_method("list_pending", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_pending_transactions_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_pending_transactions", bound_named_method);
json_connection->add_named_param_method("blockchain_get_pending_transactions", bound_named_method);
json_connection->add_named_param_method("list_pending", bound_named_method);
// register method blockchain_get_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_transaction_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_transaction", bound_named_method);
// register method blockchain_get_pretty_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_pretty_transaction_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_pretty_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_pretty_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_pretty_transaction", bound_named_method);
// register method blockchain_get_pretty_contract_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_pretty_contract_transaction_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_pretty_contract_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_pretty_contract_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_pretty_contract_transaction", bound_named_method);
// register method blockchain_get_block
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_block", bound_positional_method);
json_connection->add_method("get_block", bound_positional_method);
json_connection->add_method("getblock", bound_positional_method);
json_connection->add_method("blockchain_get_block_hash", bound_positional_method);
json_connection->add_method("blockchain_get_blockhash", bound_positional_method);
json_connection->add_method("getblockhash", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_block", bound_named_method);
json_connection->add_named_param_method("get_block", bound_named_method);
json_connection->add_named_param_method("getblock", bound_named_method);
json_connection->add_named_param_method("blockchain_get_block_hash", bound_named_method);
json_connection->add_named_param_method("blockchain_get_blockhash", bound_named_method);
json_connection->add_named_param_method("getblockhash", bound_named_method);
// register method blockchain_get_block_transactions
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_transactions_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_block_transactions", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_transactions_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_block_transactions", bound_named_method);
// register method blockchain_get_account
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_account_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_account", bound_positional_method);
json_connection->add_method("get_account", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_account_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_account", bound_named_method);
json_connection->add_named_param_method("get_account", bound_named_method);
// register method blockchain_get_slate
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_slate_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_slate", bound_positional_method);
json_connection->add_method("get_slate", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_slate_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_slate", bound_named_method);
json_connection->add_named_param_method("get_slate", bound_named_method);
// register method blockchain_get_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_balance_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_balance", bound_positional_method);
json_connection->add_method("get_balance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_balance", bound_named_method);
json_connection->add_named_param_method("get_balance", bound_named_method);
// register method blockchain_list_balances
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_balances_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_balances", bound_positional_method);
json_connection->add_method("list_balances", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_balances_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_balances", bound_named_method);
json_connection->add_named_param_method("list_balances", bound_named_method);
// register method blockchain_list_address_balances
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_address_balances_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_address_balances", bound_positional_method);
json_connection->add_method("list_address_balances", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_address_balances_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_address_balances", bound_named_method);
json_connection->add_named_param_method("list_address_balances", bound_named_method);
// register method blockchain_list_address_transactions
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_address_transactions_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_address_transactions", bound_positional_method);
json_connection->add_method("list_address_transactions", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_address_transactions_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_address_transactions", bound_named_method);
json_connection->add_named_param_method("list_address_transactions", bound_named_method);
// register method blockchain_get_account_public_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_account_public_balance_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_account_public_balance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_account_public_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_account_public_balance", bound_named_method);
// register method blockchain_list_key_balances
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_key_balances_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_key_balances", bound_positional_method);
json_connection->add_method("list_key_balances", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_key_balances_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_key_balances", bound_named_method);
json_connection->add_named_param_method("list_key_balances", bound_named_method);
// register method blockchain_get_asset
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_asset_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_asset", bound_positional_method);
json_connection->add_method("get_asset", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_asset_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_asset", bound_named_method);
json_connection->add_named_param_method("get_asset", bound_named_method);
// register method blockchain_list_active_delegates
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_active_delegates_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_active_delegates", bound_positional_method);
json_connection->add_method("blockchain_get_active_delegates", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_active_delegates_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_active_delegates", bound_named_method);
json_connection->add_named_param_method("blockchain_get_active_delegates", bound_named_method);
// register method blockchain_list_delegates
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_delegates_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_delegates", bound_positional_method);
json_connection->add_method("blockchain_get_delegates", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_delegates_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_delegates", bound_named_method);
json_connection->add_named_param_method("blockchain_get_delegates", bound_named_method);
// register method blockchain_list_blocks
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_blocks_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_blocks", bound_positional_method);
json_connection->add_method("list_blocks", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_blocks_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_blocks", bound_named_method);
json_connection->add_named_param_method("list_blocks", bound_named_method);
// register method blockchain_list_missing_block_delegates
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_missing_block_delegates_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_missing_block_delegates", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_missing_block_delegates_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_missing_block_delegates", bound_named_method);
// register method blockchain_export_fork_graph
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_export_fork_graph_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_export_fork_graph", bound_positional_method);
json_connection->add_method("export_forks", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_export_fork_graph_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_export_fork_graph", bound_named_method);
json_connection->add_named_param_method("export_forks", bound_named_method);
// register method blockchain_list_forks
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_forks_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_forks", bound_positional_method);
json_connection->add_method("list_forks", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_forks_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_forks", bound_named_method);
json_connection->add_named_param_method("list_forks", bound_named_method);
// register method blockchain_get_delegate_slot_entrys
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_delegate_slot_entrys_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_delegate_slot_entrys", bound_positional_method);
json_connection->add_method("get_slot", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_delegate_slot_entrys_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_delegate_slot_entrys", bound_named_method);
json_connection->add_named_param_method("get_slot", bound_named_method);
// register method blockchain_get_block_signee
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_signee_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_block_signee", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_block_signee_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_block_signee", bound_named_method);
// register method blockchain_unclaimed_genesis
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_unclaimed_genesis_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_unclaimed_genesis", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_unclaimed_genesis_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_unclaimed_genesis", bound_named_method);
// register method blockchain_verify_signature
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_verify_signature_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_verify_signature", bound_positional_method);
json_connection->add_method("verify_signature", bound_positional_method);
json_connection->add_method("verify_sig", bound_positional_method);
json_connection->add_method("blockchain_verify_sig", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_verify_signature_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_verify_signature", bound_named_method);
json_connection->add_named_param_method("verify_signature", bound_named_method);
json_connection->add_named_param_method("verify_sig", bound_named_method);
json_connection->add_named_param_method("blockchain_verify_sig", bound_named_method);
// register method blockchain_dump_state
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_dump_state_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_dump_state", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_dump_state_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_dump_state", bound_named_method);
// register method blockchain_broadcast_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_broadcast_transaction_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_broadcast_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_broadcast_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_broadcast_transaction", bound_named_method);
// register method blockchain_btc_address_convert
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_btc_address_convert_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_btc_address_convert", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_btc_address_convert_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_btc_address_convert", bound_named_method);
// register method blockchain_get_transaction_rpc
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_transaction_rpc_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_transaction_rpc", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_transaction_rpc_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_transaction_rpc", bound_named_method);
// register method blockchain_set_node_vm_enabled
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_set_node_vm_enabled_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_set_node_vm_enabled", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_set_node_vm_enabled_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_set_node_vm_enabled", bound_named_method);
// register method blockchain_get_node_vm_enabled
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_node_vm_enabled_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_node_vm_enabled", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_node_vm_enabled_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_node_vm_enabled", bound_named_method);
// register method blockchain_get_all_contracts
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_all_contracts_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_all_contracts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_all_contracts_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_all_contracts", bound_named_method);
// register method blockchain_get_forever_contracts
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_forever_contracts_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_forever_contracts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_forever_contracts_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_forever_contracts", bound_named_method);
// register method blockchain_list_pub_all_address
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_pub_all_address_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_pub_all_address", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_pub_all_address_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_pub_all_address", bound_named_method);
// register method network_add_node
bound_positional_method = boost::bind(&CommonApiRpcServer::network_add_node_positional,
this, capture_con, _1);
json_connection->add_method("network_add_node", bound_positional_method);
json_connection->add_method("addnode", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_add_node_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_add_node", bound_named_method);
json_connection->add_named_param_method("addnode", bound_named_method);
// register method network_get_connection_count
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_connection_count_positional,
this, capture_con, _1);
json_connection->add_method("network_get_connection_count", bound_positional_method);
json_connection->add_method("getconnectioncount", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_connection_count_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_connection_count", bound_named_method);
json_connection->add_named_param_method("getconnectioncount", bound_named_method);
// register method network_get_peer_info
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_peer_info_positional,
this, capture_con, _1);
json_connection->add_method("network_get_peer_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_peer_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_peer_info", bound_named_method);
// register method network_broadcast_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::network_broadcast_transaction_positional,
this, capture_con, _1);
json_connection->add_method("network_broadcast_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_broadcast_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_broadcast_transaction", bound_named_method);
// register method network_set_advanced_node_parameters
bound_positional_method = boost::bind(&CommonApiRpcServer::network_set_advanced_node_parameters_positional,
this, capture_con, _1);
json_connection->add_method("network_set_advanced_node_parameters", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_set_advanced_node_parameters_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_set_advanced_node_parameters", bound_named_method);
// register method network_get_advanced_node_parameters
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_advanced_node_parameters_positional,
this, capture_con, _1);
json_connection->add_method("network_get_advanced_node_parameters", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_advanced_node_parameters_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_advanced_node_parameters", bound_named_method);
// register method network_get_transaction_propagation_data
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_transaction_propagation_data_positional,
this, capture_con, _1);
json_connection->add_method("network_get_transaction_propagation_data", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_transaction_propagation_data_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_transaction_propagation_data", bound_named_method);
// register method network_get_block_propagation_data
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_block_propagation_data_positional,
this, capture_con, _1);
json_connection->add_method("network_get_block_propagation_data", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_block_propagation_data_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_block_propagation_data", bound_named_method);
// register method network_get_info
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_info_positional,
this, capture_con, _1);
json_connection->add_method("network_get_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_info", bound_named_method);
// register method network_list_potential_peers
bound_positional_method = boost::bind(&CommonApiRpcServer::network_list_potential_peers_positional,
this, capture_con, _1);
json_connection->add_method("network_list_potential_peers", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_list_potential_peers_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_list_potential_peers", bound_named_method);
// register method network_get_upnp_info
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_upnp_info_positional,
this, capture_con, _1);
json_connection->add_method("network_get_upnp_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_upnp_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_upnp_info", bound_named_method);
// register method network_get_blocked_ips
bound_positional_method = boost::bind(&CommonApiRpcServer::network_get_blocked_ips_positional,
this, capture_con, _1);
json_connection->add_method("network_get_blocked_ips", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::network_get_blocked_ips_named,
this, capture_con, _1);
json_connection->add_named_param_method("network_get_blocked_ips", bound_named_method);
// register method debug_get_client_name
bound_positional_method = boost::bind(&CommonApiRpcServer::debug_get_client_name_positional,
this, capture_con, _1);
json_connection->add_method("debug_get_client_name", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::debug_get_client_name_named,
this, capture_con, _1);
json_connection->add_named_param_method("debug_get_client_name", bound_named_method);
// register method delegate_get_config
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_get_config_positional,
this, capture_con, _1);
json_connection->add_method("delegate_get_config", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_get_config_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_get_config", bound_named_method);
// register method delegate_set_network_min_connection_count
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_network_min_connection_count_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_network_min_connection_count", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_network_min_connection_count_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_network_min_connection_count", bound_named_method);
// register method delegate_set_block_max_transaction_count
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_block_max_transaction_count_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_block_max_transaction_count", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_block_max_transaction_count_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_block_max_transaction_count", bound_named_method);
// register method delegate_set_soft_max_imessage_length
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_soft_max_imessage_length_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_soft_max_imessage_length", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_soft_max_imessage_length_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_soft_max_imessage_length", bound_named_method);
// register method delegate_set_imessage_fee_coe
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_imessage_fee_coe_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_imessage_fee_coe", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_imessage_fee_coe_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_imessage_fee_coe", bound_named_method);
// register method delegate_set_block_max_size
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_block_max_size_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_block_max_size", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_block_max_size_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_block_max_size", bound_named_method);
// register method delegate_set_transaction_max_size
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_transaction_max_size_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_transaction_max_size", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_transaction_max_size_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_transaction_max_size", bound_named_method);
// register method delegate_set_transaction_canonical_signatures_required
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_transaction_canonical_signatures_required_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_transaction_canonical_signatures_required", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_transaction_canonical_signatures_required_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_transaction_canonical_signatures_required", bound_named_method);
// register method delegate_set_transaction_min_fee
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_set_transaction_min_fee_positional,
this, capture_con, _1);
json_connection->add_method("delegate_set_transaction_min_fee", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_set_transaction_min_fee_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_set_transaction_min_fee", bound_named_method);
// register method delegate_blacklist_add_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_add_transaction_positional,
this, capture_con, _1);
json_connection->add_method("delegate_blacklist_add_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_add_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_blacklist_add_transaction", bound_named_method);
// register method delegate_blacklist_remove_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_remove_transaction_positional,
this, capture_con, _1);
json_connection->add_method("delegate_blacklist_remove_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_remove_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_blacklist_remove_transaction", bound_named_method);
// register method delegate_blacklist_add_operation
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_add_operation_positional,
this, capture_con, _1);
json_connection->add_method("delegate_blacklist_add_operation", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_add_operation_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_blacklist_add_operation", bound_named_method);
// register method delegate_blacklist_remove_operation
bound_positional_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_remove_operation_positional,
this, capture_con, _1);
json_connection->add_method("delegate_blacklist_remove_operation", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delegate_blacklist_remove_operation_named,
this, capture_con, _1);
json_connection->add_named_param_method("delegate_blacklist_remove_operation", bound_named_method);
// register method wallet_get_info
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_info_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_info", bound_named_method);
// register method wallet_open
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_open_positional,
this, capture_con, _1);
json_connection->add_method("wallet_open", bound_positional_method);
json_connection->add_method("open", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_open_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_open", bound_named_method);
json_connection->add_named_param_method("open", bound_named_method);
// register method wallet_create
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_create_positional,
this, capture_con, _1);
json_connection->add_method("wallet_create", bound_positional_method);
json_connection->add_method("create", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_create_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_create", bound_named_method);
json_connection->add_named_param_method("create", bound_named_method);
// register method wallet_get_name
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_name_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_name", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_name_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_name", bound_named_method);
// register method wallet_import_private_key
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_import_private_key_positional,
this, capture_con, _1);
json_connection->add_method("wallet_import_private_key", bound_positional_method);
json_connection->add_method("import_key", bound_positional_method);
json_connection->add_method("importprivkey", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_import_private_key_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_import_private_key", bound_named_method);
json_connection->add_named_param_method("import_key", bound_named_method);
json_connection->add_named_param_method("importprivkey", bound_named_method);
// register method wallet_close
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_close_positional,
this, capture_con, _1);
json_connection->add_method("wallet_close", bound_positional_method);
json_connection->add_method("close", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_close_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_close", bound_named_method);
json_connection->add_named_param_method("close", bound_named_method);
// register method wallet_backup_create
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_backup_create_positional,
this, capture_con, _1);
json_connection->add_method("wallet_backup_create", bound_positional_method);
json_connection->add_method("backupwallet", bound_positional_method);
json_connection->add_method("wallet_export_to_json", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_backup_create_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_backup_create", bound_named_method);
json_connection->add_named_param_method("backupwallet", bound_named_method);
json_connection->add_named_param_method("wallet_export_to_json", bound_named_method);
// register method wallet_backup_restore
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_backup_restore_positional,
this, capture_con, _1);
json_connection->add_method("wallet_backup_restore", bound_positional_method);
json_connection->add_method("wallet_create_from_json", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_backup_restore_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_backup_restore", bound_named_method);
json_connection->add_named_param_method("wallet_create_from_json", bound_named_method);
// register method wallet_set_automatic_backups
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_automatic_backups_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_automatic_backups", bound_positional_method);
json_connection->add_method("auto_backup", bound_positional_method);
json_connection->add_method("autobackup", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_automatic_backups_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_automatic_backups", bound_named_method);
json_connection->add_named_param_method("auto_backup", bound_named_method);
json_connection->add_named_param_method("autobackup", bound_named_method);
// register method wallet_set_transaction_expiration_time
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_expiration_time_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_transaction_expiration_time", bound_positional_method);
json_connection->add_method("set_expiration", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_expiration_time_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_transaction_expiration_time", bound_named_method);
json_connection->add_named_param_method("set_expiration", bound_named_method);
// register method wallet_account_transaction_history
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_transaction_history_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_transaction_history", bound_positional_method);
json_connection->add_method("history", bound_positional_method);
json_connection->add_method("listtransactions", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_transaction_history_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_transaction_history", bound_named_method);
json_connection->add_named_param_method("history", bound_named_method);
json_connection->add_named_param_method("listtransactions", bound_named_method);
// register method wallet_transaction_history_splite
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transaction_history_splite_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transaction_history_splite", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transaction_history_splite_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transaction_history_splite", bound_named_method);
// register method wallet_account_historic_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_historic_balance_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_historic_balance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_historic_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_historic_balance", bound_named_method);
// register method wallet_remove_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_remove_transaction_positional,
this, capture_con, _1);
json_connection->add_method("wallet_remove_transaction", bound_positional_method);
json_connection->add_method("remove_transaction", bound_positional_method);
json_connection->add_method("wallet_transaction_remove", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_remove_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_remove_transaction", bound_named_method);
json_connection->add_named_param_method("remove_transaction", bound_named_method);
json_connection->add_named_param_method("wallet_transaction_remove", bound_named_method);
// register method wallet_get_pending_transaction_errors
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_pending_transaction_errors_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_pending_transaction_errors", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_pending_transaction_errors_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_pending_transaction_errors", bound_named_method);
// register method wallet_lock
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_lock_positional,
this, capture_con, _1);
json_connection->add_method("wallet_lock", bound_positional_method);
json_connection->add_method("lock", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_lock_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_lock", bound_named_method);
json_connection->add_named_param_method("lock", bound_named_method);
// register method wallet_unlock
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_unlock_positional,
this, capture_con, _1);
json_connection->add_method("wallet_unlock", bound_positional_method);
json_connection->add_method("unlock", bound_positional_method);
json_connection->add_method("walletpassphrase", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_unlock_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_unlock", bound_named_method);
json_connection->add_named_param_method("unlock", bound_named_method);
json_connection->add_named_param_method("walletpassphrase", bound_named_method);
// register method wallet_change_passphrase
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_change_passphrase_positional,
this, capture_con, _1);
json_connection->add_method("wallet_change_passphrase", bound_positional_method);
json_connection->add_method("walletpassphrasechange", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_change_passphrase_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_change_passphrase", bound_named_method);
json_connection->add_named_param_method("walletpassphrasechange", bound_named_method);
// register method wallet_check_passphrase
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_check_passphrase_positional,
this, capture_con, _1);
json_connection->add_method("wallet_check_passphrase", bound_positional_method);
json_connection->add_method("check_passphrase", bound_positional_method);
json_connection->add_method("check_password", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_check_passphrase_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_check_passphrase", bound_named_method);
json_connection->add_named_param_method("check_passphrase", bound_named_method);
json_connection->add_named_param_method("check_password", bound_named_method);
// register method wallet_check_address
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_check_address_positional,
this, capture_con, _1);
json_connection->add_method("wallet_check_address", bound_positional_method);
json_connection->add_method("check_address", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_check_address_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_check_address", bound_named_method);
json_connection->add_named_param_method("check_address", bound_named_method);
// register method wallet_list
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_list_positional,
this, capture_con, _1);
json_connection->add_method("wallet_list", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_list_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_list", bound_named_method);
// register method wallet_account_create
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_create_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_create", bound_positional_method);
json_connection->add_method("wallet_create_account", bound_positional_method);
json_connection->add_method("create_account", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_create_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_create", bound_named_method);
json_connection->add_named_param_method("wallet_create_account", bound_named_method);
json_connection->add_named_param_method("create_account", bound_named_method);
// register method wallet_account_set_approval
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_set_approval_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_set_approval", bound_positional_method);
json_connection->add_method("approve", bound_positional_method);
json_connection->add_method("set_approval", bound_positional_method);
json_connection->add_method("wallet_approve_delegate", bound_positional_method);
json_connection->add_method("wallet_approve", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_set_approval_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_set_approval", bound_named_method);
json_connection->add_named_param_method("approve", bound_named_method);
json_connection->add_named_param_method("set_approval", bound_named_method);
json_connection->add_named_param_method("wallet_approve_delegate", bound_named_method);
json_connection->add_named_param_method("wallet_approve", bound_named_method);
// register method wallet_get_all_approved_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_all_approved_accounts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_all_approved_accounts", bound_positional_method);
json_connection->add_method("all_approved_accounts", bound_positional_method);
json_connection->add_method("approved_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_all_approved_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_all_approved_accounts", bound_named_method);
json_connection->add_named_param_method("all_approved_accounts", bound_named_method);
json_connection->add_named_param_method("approved_accounts", bound_named_method);
// register method wallet_address_create
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_address_create_positional,
this, capture_con, _1);
json_connection->add_method("wallet_address_create", bound_positional_method);
json_connection->add_method("new_address", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_address_create_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_address_create", bound_named_method);
json_connection->add_named_param_method("new_address", bound_named_method);
// register method wallet_transfer_to_address
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_address_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transfer_to_address", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_address_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transfer_to_address", bound_named_method);
// register method wallet_transfer_to_public_account
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_public_account_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transfer_to_public_account", bound_positional_method);
json_connection->add_method("transfer_public", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_public_account_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transfer_to_public_account", bound_named_method);
json_connection->add_named_param_method("transfer_public", bound_named_method);
// register method wallet_withdraw_from_address
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_withdraw_from_address_positional,
this, capture_con, _1);
json_connection->add_method("wallet_withdraw_from_address", bound_positional_method);
json_connection->add_method("withdraw_from_address", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_withdraw_from_address_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_withdraw_from_address", bound_named_method);
json_connection->add_named_param_method("withdraw_from_address", bound_named_method);
// register method wallet_rescan_blockchain
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_rescan_blockchain_positional,
this, capture_con, _1);
json_connection->add_method("wallet_rescan_blockchain", bound_positional_method);
json_connection->add_method("scan", bound_positional_method);
json_connection->add_method("rescan", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_rescan_blockchain_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_rescan_blockchain", bound_named_method);
json_connection->add_named_param_method("scan", bound_named_method);
json_connection->add_named_param_method("rescan", bound_named_method);
// register method wallet_cancel_scan
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_cancel_scan_positional,
this, capture_con, _1);
json_connection->add_method("wallet_cancel_scan", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_cancel_scan_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_cancel_scan", bound_named_method);
// register method wallet_get_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_transaction", bound_positional_method);
json_connection->add_method("get_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_transaction", bound_named_method);
json_connection->add_named_param_method("get_transaction", bound_named_method);
// register method wallet_scan_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_scan_transaction_positional,
this, capture_con, _1);
json_connection->add_method("wallet_scan_transaction", bound_positional_method);
json_connection->add_method("scan_transaction", bound_positional_method);
json_connection->add_method("wallet_transaction_scan", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_scan_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_scan_transaction", bound_named_method);
json_connection->add_named_param_method("scan_transaction", bound_named_method);
json_connection->add_named_param_method("wallet_transaction_scan", bound_named_method);
// register method wallet_rebroadcast_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_rebroadcast_transaction_positional,
this, capture_con, _1);
json_connection->add_method("wallet_rebroadcast_transaction", bound_positional_method);
json_connection->add_method("rebroadcast", bound_positional_method);
json_connection->add_method("wallet_transaction_rebroadcast", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_rebroadcast_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_rebroadcast_transaction", bound_named_method);
json_connection->add_named_param_method("rebroadcast", bound_named_method);
json_connection->add_named_param_method("wallet_transaction_rebroadcast", bound_named_method);
// register method wallet_account_register
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_register_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_register", bound_positional_method);
json_connection->add_method("register", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_register_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_register", bound_named_method);
json_connection->add_named_param_method("register", bound_named_method);
// register method wallet_account_update_private_data
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_update_private_data_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_update_private_data", bound_positional_method);
json_connection->add_method("update_private_data", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_update_private_data_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_update_private_data", bound_named_method);
json_connection->add_named_param_method("update_private_data", bound_named_method);
// register method wallet_account_update_registration
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_update_registration_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_update_registration", bound_positional_method);
json_connection->add_method("update_registration", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_update_registration_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_update_registration", bound_named_method);
json_connection->add_named_param_method("update_registration", bound_named_method);
// register method wallet_account_update_active_key
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_update_active_key_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_update_active_key", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_update_active_key_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_update_active_key", bound_named_method);
// register method wallet_list_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_list_accounts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_list_accounts", bound_positional_method);
json_connection->add_method("listaccounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_list_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_list_accounts", bound_named_method);
json_connection->add_named_param_method("listaccounts", bound_named_method);
// register method wallet_list_unregistered_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_list_unregistered_accounts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_list_unregistered_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_list_unregistered_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_list_unregistered_accounts", bound_named_method);
// register method wallet_list_my_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_list_my_accounts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_list_my_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_list_my_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_list_my_accounts", bound_named_method);
// register method wallet_list_my_addresses
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_list_my_addresses_positional,
this, capture_con, _1);
json_connection->add_method("wallet_list_my_addresses", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_list_my_addresses_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_list_my_addresses", bound_named_method);
// register method wallet_get_account
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_account_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_account", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_account_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_account", bound_named_method);
// register method wallet_get_account_public_address
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_account_public_address_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_account_public_address", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_account_public_address_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_account_public_address", bound_named_method);
// register method wallet_remove_contact_account
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_remove_contact_account_positional,
this, capture_con, _1);
json_connection->add_method("wallet_remove_contact_account", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_remove_contact_account_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_remove_contact_account", bound_named_method);
// register method wallet_account_rename
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_rename_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_rename", bound_positional_method);
json_connection->add_method("wallet_rename_account", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_rename_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_rename", bound_named_method);
json_connection->add_named_param_method("wallet_rename_account", bound_named_method);
// register method wallet_asset_create
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_asset_create_positional,
this, capture_con, _1);
json_connection->add_method("wallet_asset_create", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_asset_create_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_asset_create", bound_named_method);
// register method wallet_asset_issue
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_asset_issue_positional,
this, capture_con, _1);
json_connection->add_method("wallet_asset_issue", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_asset_issue_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_asset_issue", bound_named_method);
// register method wallet_asset_issue_to_addresses
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_asset_issue_to_addresses_positional,
this, capture_con, _1);
json_connection->add_method("wallet_asset_issue_to_addresses", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_asset_issue_to_addresses_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_asset_issue_to_addresses", bound_named_method);
// register method wallet_account_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_balance_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_balance", bound_positional_method);
json_connection->add_method("balance", bound_positional_method);
json_connection->add_method("getbalance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_balance", bound_named_method);
json_connection->add_named_param_method("balance", bound_named_method);
json_connection->add_named_param_method("getbalance", bound_named_method);
// register method wallet_account_balance_ids
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_balance_ids_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_balance_ids", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_balance_ids_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_balance_ids", bound_named_method);
// register method wallet_account_list_public_keys
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_list_public_keys_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_list_public_keys", bound_positional_method);
json_connection->add_method("public_keys", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_list_public_keys_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_list_public_keys", bound_named_method);
json_connection->add_named_param_method("public_keys", bound_named_method);
// register method wallet_delegate_withdraw_pay
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_delegate_withdraw_pay_positional,
this, capture_con, _1);
json_connection->add_method("wallet_delegate_withdraw_pay", bound_positional_method);
json_connection->add_method("pay_delegate", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_delegate_withdraw_pay_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_delegate_withdraw_pay", bound_named_method);
json_connection->add_named_param_method("pay_delegate", bound_named_method);
// register method wallet_delegate_pay_balance_query
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_delegate_pay_balance_query_positional,
this, capture_con, _1);
json_connection->add_method("wallet_delegate_pay_balance_query", bound_positional_method);
json_connection->add_method("query_salary", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_delegate_pay_balance_query_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_delegate_pay_balance_query", bound_named_method);
json_connection->add_named_param_method("query_salary", bound_named_method);
// register method wallet_active_delegate_salary
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_active_delegate_salary_positional,
this, capture_con, _1);
json_connection->add_method("wallet_active_delegate_salary", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_active_delegate_salary_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_active_delegate_salary", bound_named_method);
// register method wallet_get_delegate_statue
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_delegate_statue_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_delegate_statue", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_delegate_statue_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_delegate_statue", bound_named_method);
// register method wallet_set_transaction_imessage_fee_coe
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_imessage_fee_coe_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_transaction_imessage_fee_coe", bound_positional_method);
json_connection->add_method("set_fee_coe", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_imessage_fee_coe_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_transaction_imessage_fee_coe", bound_named_method);
json_connection->add_named_param_method("set_fee_coe", bound_named_method);
// register method wallet_get_transaction_imessage_fee_coe
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_imessage_fee_coe_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_transaction_imessage_fee_coe", bound_positional_method);
json_connection->add_method("get_fee_coe", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_imessage_fee_coe_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_transaction_imessage_fee_coe", bound_named_method);
json_connection->add_named_param_method("get_fee_coe", bound_named_method);
// register method wallet_set_transaction_imessage_soft_max_length
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_imessage_soft_max_length_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_transaction_imessage_soft_max_length", bound_positional_method);
json_connection->add_method("set_soft_length", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_imessage_soft_max_length_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_transaction_imessage_soft_max_length", bound_named_method);
json_connection->add_named_param_method("set_soft_length", bound_named_method);
// register method wallet_get_transaction_imessage_soft_max_length
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_imessage_soft_max_length_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_transaction_imessage_soft_max_length", bound_positional_method);
json_connection->add_method("get_soft_length", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_imessage_soft_max_length_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_transaction_imessage_soft_max_length", bound_named_method);
json_connection->add_named_param_method("get_soft_length", bound_named_method);
// register method wallet_set_transaction_fee
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_fee_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_transaction_fee", bound_positional_method);
json_connection->add_method("wallet_set_priority_fee", bound_positional_method);
json_connection->add_method("set_priority_fee", bound_positional_method);
json_connection->add_method("settrxfee", bound_positional_method);
json_connection->add_method("setfee", bound_positional_method);
json_connection->add_method("set_fee", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_fee_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_transaction_fee", bound_named_method);
json_connection->add_named_param_method("wallet_set_priority_fee", bound_named_method);
json_connection->add_named_param_method("set_priority_fee", bound_named_method);
json_connection->add_named_param_method("settrxfee", bound_named_method);
json_connection->add_named_param_method("setfee", bound_named_method);
json_connection->add_named_param_method("set_fee", bound_named_method);
// register method wallet_get_transaction_fee
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_fee_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_transaction_fee", bound_positional_method);
json_connection->add_method("wallet_get_priority_fee", bound_positional_method);
json_connection->add_method("get_priority_fee", bound_positional_method);
json_connection->add_method("gettrxfee", bound_positional_method);
json_connection->add_method("getfee", bound_positional_method);
json_connection->add_method("get_fee", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_transaction_fee_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_transaction_fee", bound_named_method);
json_connection->add_named_param_method("wallet_get_priority_fee", bound_named_method);
json_connection->add_named_param_method("get_priority_fee", bound_named_method);
json_connection->add_named_param_method("gettrxfee", bound_named_method);
json_connection->add_named_param_method("getfee", bound_named_method);
json_connection->add_named_param_method("get_fee", bound_named_method);
// register method wallet_dump_private_key
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_dump_private_key_positional,
this, capture_con, _1);
json_connection->add_method("wallet_dump_private_key", bound_positional_method);
json_connection->add_method("dump_private_key", bound_positional_method);
json_connection->add_method("dumpprivkey", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_dump_private_key_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_dump_private_key", bound_named_method);
json_connection->add_named_param_method("dump_private_key", bound_named_method);
json_connection->add_named_param_method("dumpprivkey", bound_named_method);
// register method wallet_dump_account_private_key
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_dump_account_private_key_positional,
this, capture_con, _1);
json_connection->add_method("wallet_dump_account_private_key", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_dump_account_private_key_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_dump_account_private_key", bound_named_method);
// register method wallet_account_vote_summary
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_vote_summary_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_vote_summary", bound_positional_method);
json_connection->add_method("votes", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_vote_summary_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_vote_summary", bound_named_method);
json_connection->add_named_param_method("votes", bound_named_method);
// register method wallet_check_vote_status
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_check_vote_status_positional,
this, capture_con, _1);
json_connection->add_method("wallet_check_vote_status", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_check_vote_status_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_check_vote_status", bound_named_method);
// register method wallet_set_setting
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_setting_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_setting", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_setting_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_setting", bound_named_method);
// register method wallet_get_setting
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_setting_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_setting", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_setting_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_setting", bound_named_method);
// register method wallet_delegate_set_block_production
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_delegate_set_block_production_positional,
this, capture_con, _1);
json_connection->add_method("wallet_delegate_set_block_production", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_delegate_set_block_production_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_delegate_set_block_production", bound_named_method);
// register method wallet_set_transaction_scanning
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_scanning_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_transaction_scanning", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_transaction_scanning_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_transaction_scanning", bound_named_method);
// register method wallet_sign_hash
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_sign_hash_positional,
this, capture_con, _1);
json_connection->add_method("wallet_sign_hash", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_sign_hash_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_sign_hash", bound_named_method);
// register method wallet_login_start
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_login_start_positional,
this, capture_con, _1);
json_connection->add_method("wallet_login_start", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_login_start_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_login_start", bound_named_method);
// register method wallet_login_finish
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_login_finish_positional,
this, capture_con, _1);
json_connection->add_method("wallet_login_finish", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_login_finish_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_login_finish", bound_named_method);
// register method wallet_balance_set_vote_info
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_balance_set_vote_info_positional,
this, capture_con, _1);
json_connection->add_method("wallet_balance_set_vote_info", bound_positional_method);
json_connection->add_method("set_vote_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_balance_set_vote_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_balance_set_vote_info", bound_named_method);
json_connection->add_named_param_method("set_vote_info", bound_named_method);
// register method wallet_publish_slate
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_publish_slate_positional,
this, capture_con, _1);
json_connection->add_method("wallet_publish_slate", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_publish_slate_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_publish_slate", bound_named_method);
// register method wallet_publish_version
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_publish_version_positional,
this, capture_con, _1);
json_connection->add_method("wallet_publish_version", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_publish_version_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_publish_version", bound_named_method);
// register method wallet_collect_genesis_balances
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_collect_genesis_balances_positional,
this, capture_con, _1);
json_connection->add_method("wallet_collect_genesis_balances", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_collect_genesis_balances_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_collect_genesis_balances", bound_named_method);
// register method wallet_recover_accounts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_recover_accounts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_recover_accounts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_recover_accounts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_recover_accounts", bound_named_method);
// register method wallet_verify_titan_deposit
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_verify_titan_deposit_positional,
this, capture_con, _1);
json_connection->add_method("wallet_verify_titan_deposit", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_verify_titan_deposit_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_verify_titan_deposit", bound_named_method);
// register method wallet_repair_entrys
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_repair_entrys_positional,
this, capture_con, _1);
json_connection->add_method("wallet_repair_entrys", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_repair_entrys_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_repair_entrys", bound_named_method);
// register method wallet_regenerate_keys
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_regenerate_keys_positional,
this, capture_con, _1);
json_connection->add_method("wallet_regenerate_keys", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_regenerate_keys_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_regenerate_keys", bound_named_method);
// register method wallet_account_retract
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_retract_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_retract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_retract_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_retract", bound_named_method);
// register method wallet_account_delete
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_delete_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_delete", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_delete_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_delete", bound_named_method);
// register method wallet_transfer_to_address_rpc
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_address_rpc_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transfer_to_address_rpc", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_address_rpc_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transfer_to_address_rpc", bound_named_method);
// register method wallet_account_balance_rpc
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_account_balance_rpc_positional,
this, capture_con, _1);
json_connection->add_method("wallet_account_balance_rpc", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_account_balance_rpc_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_account_balance_rpc", bound_named_method);
// register method wallet_transfer_to_public_account_rpc
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_public_account_rpc_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transfer_to_public_account_rpc", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_public_account_rpc_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transfer_to_public_account_rpc", bound_named_method);
// register method wallet_get_account_owner_publickey
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_account_owner_publickey_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_account_owner_publickey", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_account_owner_publickey_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_account_owner_publickey", bound_named_method);
// register method wallet_transfer_to_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_contract_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transfer_to_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transfer_to_contract", bound_named_method);
// register method wallet_transfer_to_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("wallet_transfer_to_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_transfer_to_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_transfer_to_contract_testing", bound_named_method);
// register method wallet_get_contracts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_contracts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_contracts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_contracts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_contracts", bound_named_method);
// register method wallet_scan_contracts
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_scan_contracts_positional,
this, capture_con, _1);
json_connection->add_method("wallet_scan_contracts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_scan_contracts_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_scan_contracts", bound_named_method);
// register method about
bound_positional_method = boost::bind(&CommonApiRpcServer::about_positional,
this, capture_con, _1);
json_connection->add_method("about", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::about_named,
this, capture_con, _1);
json_connection->add_named_param_method("about", bound_named_method);
// register method get_info
bound_positional_method = boost::bind(&CommonApiRpcServer::get_info_positional,
this, capture_con, _1);
json_connection->add_method("get_info", bound_positional_method);
json_connection->add_method("getinfo", bound_positional_method);
json_connection->add_method("info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_info", bound_named_method);
json_connection->add_named_param_method("getinfo", bound_named_method);
json_connection->add_named_param_method("info", bound_named_method);
// register method stop
bound_positional_method = boost::bind(&CommonApiRpcServer::stop_positional,
this, capture_con, _1);
json_connection->add_method("stop", bound_positional_method);
json_connection->add_method("quit", bound_positional_method);
json_connection->add_method("exit", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::stop_named,
this, capture_con, _1);
json_connection->add_named_param_method("stop", bound_named_method);
json_connection->add_named_param_method("quit", bound_named_method);
json_connection->add_named_param_method("exit", bound_named_method);
// register method help
bound_positional_method = boost::bind(&CommonApiRpcServer::help_positional,
this, capture_con, _1);
json_connection->add_method("help", bound_positional_method);
json_connection->add_method("h", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::help_named,
this, capture_con, _1);
json_connection->add_named_param_method("help", bound_named_method);
json_connection->add_named_param_method("h", bound_named_method);
// register method validate_address
bound_positional_method = boost::bind(&CommonApiRpcServer::validate_address_positional,
this, capture_con, _1);
json_connection->add_method("validate_address", bound_positional_method);
json_connection->add_method("validateaddress", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::validate_address_named,
this, capture_con, _1);
json_connection->add_named_param_method("validate_address", bound_named_method);
json_connection->add_named_param_method("validateaddress", bound_named_method);
// register method execute_command_line
bound_positional_method = boost::bind(&CommonApiRpcServer::execute_command_line_positional,
this, capture_con, _1);
json_connection->add_method("execute_command_line", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::execute_command_line_named,
this, capture_con, _1);
json_connection->add_named_param_method("execute_command_line", bound_named_method);
// register method execute_script
bound_positional_method = boost::bind(&CommonApiRpcServer::execute_script_positional,
this, capture_con, _1);
json_connection->add_method("execute_script", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::execute_script_named,
this, capture_con, _1);
json_connection->add_named_param_method("execute_script", bound_named_method);
// register method batch
bound_positional_method = boost::bind(&CommonApiRpcServer::batch_positional,
this, capture_con, _1);
json_connection->add_method("batch", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::batch_named,
this, capture_con, _1);
json_connection->add_named_param_method("batch", bound_named_method);
// register method batch_authenticated
bound_positional_method = boost::bind(&CommonApiRpcServer::batch_authenticated_positional,
this, capture_con, _1);
json_connection->add_method("batch_authenticated", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::batch_authenticated_named,
this, capture_con, _1);
json_connection->add_named_param_method("batch_authenticated", bound_named_method);
// register method builder_finalize_and_sign
bound_positional_method = boost::bind(&CommonApiRpcServer::builder_finalize_and_sign_positional,
this, capture_con, _1);
json_connection->add_method("builder_finalize_and_sign", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::builder_finalize_and_sign_named,
this, capture_con, _1);
json_connection->add_named_param_method("builder_finalize_and_sign", bound_named_method);
// register method meta_help
bound_positional_method = boost::bind(&CommonApiRpcServer::meta_help_positional,
this, capture_con, _1);
json_connection->add_method("meta_help", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::meta_help_named,
this, capture_con, _1);
json_connection->add_named_param_method("meta_help", bound_named_method);
// register method rpc_set_username
bound_positional_method = boost::bind(&CommonApiRpcServer::rpc_set_username_positional,
this, capture_con, _1);
json_connection->add_method("rpc_set_username", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::rpc_set_username_named,
this, capture_con, _1);
json_connection->add_named_param_method("rpc_set_username", bound_named_method);
// register method rpc_set_password
bound_positional_method = boost::bind(&CommonApiRpcServer::rpc_set_password_positional,
this, capture_con, _1);
json_connection->add_method("rpc_set_password", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::rpc_set_password_named,
this, capture_con, _1);
json_connection->add_named_param_method("rpc_set_password", bound_named_method);
// register method rpc_start_server
bound_positional_method = boost::bind(&CommonApiRpcServer::rpc_start_server_positional,
this, capture_con, _1);
json_connection->add_method("rpc_start_server", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::rpc_start_server_named,
this, capture_con, _1);
json_connection->add_named_param_method("rpc_start_server", bound_named_method);
// register method http_start_server
bound_positional_method = boost::bind(&CommonApiRpcServer::http_start_server_positional,
this, capture_con, _1);
json_connection->add_method("http_start_server", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::http_start_server_named,
this, capture_con, _1);
json_connection->add_named_param_method("http_start_server", bound_named_method);
// register method ntp_update_time
bound_positional_method = boost::bind(&CommonApiRpcServer::ntp_update_time_positional,
this, capture_con, _1);
json_connection->add_method("ntp_update_time", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::ntp_update_time_named,
this, capture_con, _1);
json_connection->add_named_param_method("ntp_update_time", bound_named_method);
// register method disk_usage
bound_positional_method = boost::bind(&CommonApiRpcServer::disk_usage_positional,
this, capture_con, _1);
json_connection->add_method("disk_usage", bound_positional_method);
json_connection->add_method("size", bound_positional_method);
json_connection->add_method("sizes", bound_positional_method);
json_connection->add_method("usage", bound_positional_method);
json_connection->add_method("diskusage", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::disk_usage_named,
this, capture_con, _1);
json_connection->add_named_param_method("disk_usage", bound_named_method);
json_connection->add_named_param_method("size", bound_named_method);
json_connection->add_named_param_method("sizes", bound_named_method);
json_connection->add_named_param_method("usage", bound_named_method);
json_connection->add_named_param_method("diskusage", bound_named_method);
// register method compile_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::compile_contract_positional,
this, capture_con, _1);
json_connection->add_method("compile_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::compile_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("compile_contract", bound_named_method);
// register method register_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::register_contract_positional,
this, capture_con, _1);
json_connection->add_method("register_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::register_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("register_contract", bound_named_method);
// register method register_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::register_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("register_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::register_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("register_contract_testing", bound_named_method);
// register method upgrade_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::upgrade_contract_positional,
this, capture_con, _1);
json_connection->add_method("upgrade_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::upgrade_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("upgrade_contract", bound_named_method);
// register method upgrade_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::upgrade_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("upgrade_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::upgrade_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("upgrade_contract_testing", bound_named_method);
// register method destroy_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::destroy_contract_positional,
this, capture_con, _1);
json_connection->add_method("destroy_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::destroy_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("destroy_contract", bound_named_method);
// register method destroy_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::destroy_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("destroy_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::destroy_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("destroy_contract_testing", bound_named_method);
// register method call_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::call_contract_positional,
this, capture_con, _1);
json_connection->add_method("call_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::call_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("call_contract", bound_named_method);
// register method get_contract_info
bound_positional_method = boost::bind(&CommonApiRpcServer::get_contract_info_positional,
this, capture_con, _1);
json_connection->add_method("get_contract_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_contract_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_contract_info", bound_named_method);
// register method get_contract_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::get_contract_balance_positional,
this, capture_con, _1);
json_connection->add_method("get_contract_balance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_contract_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_contract_balance", bound_named_method);
// register method call_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::call_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("call_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::call_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("call_contract_testing", bound_named_method);
// register method call_contract_offline
bound_positional_method = boost::bind(&CommonApiRpcServer::call_contract_offline_positional,
this, capture_con, _1);
json_connection->add_method("call_contract_offline", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::call_contract_offline_named,
this, capture_con, _1);
json_connection->add_named_param_method("call_contract_offline", bound_named_method);
// register method load_contract_to_file
bound_positional_method = boost::bind(&CommonApiRpcServer::load_contract_to_file_positional,
this, capture_con, _1);
json_connection->add_method("load_contract_to_file", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::load_contract_to_file_named,
this, capture_con, _1);
json_connection->add_named_param_method("load_contract_to_file", bound_named_method);
// register method get_result_trx_id
bound_positional_method = boost::bind(&CommonApiRpcServer::get_result_trx_id_positional,
this, capture_con, _1);
json_connection->add_method("get_result_trx_id", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_result_trx_id_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_result_trx_id", bound_named_method);
// register method get_request_trx_id
bound_positional_method = boost::bind(&CommonApiRpcServer::get_request_trx_id_positional,
this, capture_con, _1);
json_connection->add_method("get_request_trx_id", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_request_trx_id_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_request_trx_id", bound_named_method);
// register method sandbox_open
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_open_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_open", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_open_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_open", bound_named_method);
// register method sandbox_close
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_close_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_close", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_close_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_close", bound_named_method);
// register method sandbox_register_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_register_contract_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_register_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_register_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_register_contract", bound_named_method);
// register method sandbox_call_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_call_contract_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_call_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_call_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_call_contract", bound_named_method);
// register method sandbox_upgrade_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_upgrade_contract_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_upgrade_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_upgrade_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_upgrade_contract", bound_named_method);
// register method sandbox_upgrade_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_upgrade_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_upgrade_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_upgrade_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_upgrade_contract_testing", bound_named_method);
// register method sandbox_destroy_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_destroy_contract_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_destroy_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_destroy_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_destroy_contract", bound_named_method);
// register method sandbox_destroy_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_destroy_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_destroy_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_destroy_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_destroy_contract_testing", bound_named_method);
// register method sandbox_get_contract_info
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_get_contract_info_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_get_contract_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_get_contract_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_get_contract_info", bound_named_method);
// register method sandbox_get_contract_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_get_contract_balance_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_get_contract_balance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_get_contract_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_get_contract_balance", bound_named_method);
// register method sandbox_transfer_to_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_transfer_to_contract_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_transfer_to_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_transfer_to_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_transfer_to_contract", bound_named_method);
// register method sandbox_account_balance
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_account_balance_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_account_balance", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_account_balance_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_account_balance", bound_named_method);
// register method sandbox_compile_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_compile_contract_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_compile_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_compile_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_compile_contract", bound_named_method);
// register method sandbox_load_contract_to_file
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_load_contract_to_file_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_load_contract_to_file", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_load_contract_to_file_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_load_contract_to_file", bound_named_method);
// register method sandbox_register_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_register_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_register_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_register_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_register_contract_testing", bound_named_method);
// register method sandbox_call_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_call_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_call_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_call_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_call_contract_testing", bound_named_method);
// register method sandbox_transfer_to_contract_testing
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_transfer_to_contract_testing_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_transfer_to_contract_testing", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_transfer_to_contract_testing_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_transfer_to_contract_testing", bound_named_method);
// register method sandbox_list_my_addresses
bound_positional_method = boost::bind(&CommonApiRpcServer::sandbox_list_my_addresses_positional,
this, capture_con, _1);
json_connection->add_method("sandbox_list_my_addresses", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::sandbox_list_my_addresses_named,
this, capture_con, _1);
json_connection->add_named_param_method("sandbox_list_my_addresses", bound_named_method);
// register method get_contract_registered_in_transaction
bound_positional_method = boost::bind(&CommonApiRpcServer::get_contract_registered_in_transaction_positional,
this, capture_con, _1);
json_connection->add_method("get_contract_registered_in_transaction", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_contract_registered_in_transaction_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_contract_registered_in_transaction", bound_named_method);
// register method get_transaction_id_contract_registered
bound_positional_method = boost::bind(&CommonApiRpcServer::get_transaction_id_contract_registered_positional,
this, capture_con, _1);
json_connection->add_method("get_transaction_id_contract_registered", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_transaction_id_contract_registered_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_transaction_id_contract_registered", bound_named_method);
// register method get_contract_info_from_gpc_file
bound_positional_method = boost::bind(&CommonApiRpcServer::get_contract_info_from_gpc_file_positional,
this, capture_con, _1);
json_connection->add_method("get_contract_info_from_gpc_file", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_contract_info_from_gpc_file_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_contract_info_from_gpc_file", bound_named_method);
// register method compile_script
bound_positional_method = boost::bind(&CommonApiRpcServer::compile_script_positional,
this, capture_con, _1);
json_connection->add_method("compile_script", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::compile_script_named,
this, capture_con, _1);
json_connection->add_named_param_method("compile_script", bound_named_method);
// register method add_script
bound_positional_method = boost::bind(&CommonApiRpcServer::add_script_positional,
this, capture_con, _1);
json_connection->add_method("add_script", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::add_script_named,
this, capture_con, _1);
json_connection->add_named_param_method("add_script", bound_named_method);
// register method remove_script
bound_positional_method = boost::bind(&CommonApiRpcServer::remove_script_positional,
this, capture_con, _1);
json_connection->add_method("remove_script", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::remove_script_named,
this, capture_con, _1);
json_connection->add_named_param_method("remove_script", bound_named_method);
// register method get_script_info
bound_positional_method = boost::bind(&CommonApiRpcServer::get_script_info_positional,
this, capture_con, _1);
json_connection->add_method("get_script_info", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_script_info_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_script_info", bound_named_method);
// register method list_scripts
bound_positional_method = boost::bind(&CommonApiRpcServer::list_scripts_positional,
this, capture_con, _1);
json_connection->add_method("list_scripts", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::list_scripts_named,
this, capture_con, _1);
json_connection->add_named_param_method("list_scripts", bound_named_method);
// register method disable_script
bound_positional_method = boost::bind(&CommonApiRpcServer::disable_script_positional,
this, capture_con, _1);
json_connection->add_method("disable_script", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::disable_script_named,
this, capture_con, _1);
json_connection->add_named_param_method("disable_script", bound_named_method);
// register method enable_script
bound_positional_method = boost::bind(&CommonApiRpcServer::enable_script_positional,
this, capture_con, _1);
json_connection->add_method("enable_script", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::enable_script_named,
this, capture_con, _1);
json_connection->add_named_param_method("enable_script", bound_named_method);
// register method import_script_db
bound_positional_method = boost::bind(&CommonApiRpcServer::import_script_db_positional,
this, capture_con, _1);
json_connection->add_method("import_script_db", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::import_script_db_named,
this, capture_con, _1);
json_connection->add_named_param_method("import_script_db", bound_named_method);
// register method export_script_db
bound_positional_method = boost::bind(&CommonApiRpcServer::export_script_db_positional,
this, capture_con, _1);
json_connection->add_method("export_script_db", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::export_script_db_named,
this, capture_con, _1);
json_connection->add_named_param_method("export_script_db", bound_named_method);
// register method get_events_bound
bound_positional_method = boost::bind(&CommonApiRpcServer::get_events_bound_positional,
this, capture_con, _1);
json_connection->add_method("get_events_bound", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_events_bound_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_events_bound", bound_named_method);
// register method list_event_handler
bound_positional_method = boost::bind(&CommonApiRpcServer::list_event_handler_positional,
this, capture_con, _1);
json_connection->add_method("list_event_handler", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::list_event_handler_named,
this, capture_con, _1);
json_connection->add_named_param_method("list_event_handler", bound_named_method);
// register method add_event_handler
bound_positional_method = boost::bind(&CommonApiRpcServer::add_event_handler_positional,
this, capture_con, _1);
json_connection->add_method("add_event_handler", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::add_event_handler_named,
this, capture_con, _1);
json_connection->add_named_param_method("add_event_handler", bound_named_method);
// register method delete_event_handler
bound_positional_method = boost::bind(&CommonApiRpcServer::delete_event_handler_positional,
this, capture_con, _1);
json_connection->add_method("delete_event_handler", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::delete_event_handler_named,
this, capture_con, _1);
json_connection->add_named_param_method("delete_event_handler", bound_named_method);
// register method store_file_to_network
bound_positional_method = boost::bind(&CommonApiRpcServer::store_file_to_network_positional,
this, capture_con, _1);
json_connection->add_method("store_file_to_network", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::store_file_to_network_named,
this, capture_con, _1);
json_connection->add_named_param_method("store_file_to_network", bound_named_method);
// register method get_file_access
bound_positional_method = boost::bind(&CommonApiRpcServer::get_file_access_positional,
this, capture_con, _1);
json_connection->add_method("get_file_access", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::get_file_access_named,
this, capture_con, _1);
json_connection->add_named_param_method("get_file_access", bound_named_method);
// register method store_file_piece
bound_positional_method = boost::bind(&CommonApiRpcServer::store_file_piece_positional,
this, capture_con, _1);
json_connection->add_method("store_file_piece", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::store_file_piece_named,
this, capture_con, _1);
json_connection->add_named_param_method("store_file_piece", bound_named_method);
// register method store_reject
bound_positional_method = boost::bind(&CommonApiRpcServer::store_reject_positional,
this, capture_con, _1);
json_connection->add_method("store_reject", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::store_reject_named,
this, capture_con, _1);
json_connection->add_named_param_method("store_reject", bound_named_method);
// register method wallet_set_node_id
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_set_node_id_positional,
this, capture_con, _1);
json_connection->add_method("wallet_set_node_id", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_set_node_id_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_set_node_id", bound_named_method);
// register method blockchain_list_file_saved
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_list_file_saved_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_list_file_saved", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_list_file_saved_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_list_file_saved", bound_named_method);
// register method blockchain_get_file_authorizing_contract
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_file_authorizing_contract_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_file_authorizing_contract", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_file_authorizing_contract_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_file_authorizing_contract", bound_named_method);
// register method wallet_list_store_request_for_my_file
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_list_store_request_for_my_file_positional,
this, capture_con, _1);
json_connection->add_method("wallet_list_store_request_for_my_file", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_list_store_request_for_my_file_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_list_store_request_for_my_file", bound_named_method);
// register method blockchain_check_signature
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_check_signature_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_check_signature", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_check_signature_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_check_signature", bound_named_method);
// register method wallet_get_my_access
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_my_access_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_my_access", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_my_access_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_my_access", bound_named_method);
// register method wallet_get_my_upload_requests
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_my_upload_requests_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_my_upload_requests", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_my_upload_requests_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_my_upload_requests", bound_named_method);
// register method wallet_get_my_store_request
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_my_store_request_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_my_store_request", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_my_store_request_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_my_store_request", bound_named_method);
// register method wallet_get_my_store_confirmed
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_my_store_confirmed_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_my_store_confirmed", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_my_store_confirmed_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_my_store_confirmed", bound_named_method);
// register method wallet_get_my_store_rejected
bound_positional_method = boost::bind(&CommonApiRpcServer::wallet_get_my_store_rejected_positional,
this, capture_con, _1);
json_connection->add_method("wallet_get_my_store_rejected", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::wallet_get_my_store_rejected_named,
this, capture_con, _1);
json_connection->add_named_param_method("wallet_get_my_store_rejected", bound_named_method);
// register method blockchain_get_file_save_node
bound_positional_method = boost::bind(&CommonApiRpcServer::blockchain_get_file_save_node_positional,
this, capture_con, _1);
json_connection->add_method("blockchain_get_file_save_node", bound_positional_method);
bound_named_method = boost::bind(&CommonApiRpcServer::blockchain_get_file_save_node_named,
this, capture_con, _1);
json_connection->add_named_param_method("blockchain_get_file_save_node", bound_named_method);
}
void CommonApiRpcServer::register_CommonApi_method_metadata()
{
{
// register method blockchain_get_info
TiValue::api::MethodData blockchain_get_info_method_metadata{"blockchain_get_info", nullptr,
/* description */ "Returns current blockchain information and parameters",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns current blockchain information and parameters\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {"getconfig", "get_config", "config", "blockchain_get_config"}, true};
store_method_metadata(blockchain_get_info_method_metadata);
}
{
// register method blockchain_generate_snapshot
TiValue::api::MethodData blockchain_generate_snapshot_method_metadata{"blockchain_generate_snapshot", nullptr,
/* description */ "Save snapshot of current base asset balances to specified file",
/* returns */ "void",
/* params: */ {
{"filename", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Save snapshot of current base asset balances to specified file\n\nParameters:\n filename (string, required): filename to save snapshot to\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_generate_snapshot_method_metadata);
}
{
// register method blockchain_get_alp_account_balance_entry
TiValue::api::MethodData blockchain_get_alp_account_balance_entry_method_metadata{"blockchain_get_alp_account_balance_entry", nullptr,
/* description */ "fetch all AlpTrxidBalance from block where blocknum of the block lower than block_num or equal to block_num.",
/* returns */ "vector<alp_trxid_balance>",
/* params: */ {
{"block_num", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "fetch all AlpTrxidBalance from block where blocknum of the block lower than block_num or equal to block_num.\n\nParameters:\n block_num (uint32_t, required): \n\nReturns:\n vector<alp_trxid_balance>\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_get_alp_account_balance_entry_method_metadata);
}
{
// register method blockchain_generate_issuance_map
TiValue::api::MethodData blockchain_generate_issuance_map_method_metadata{"blockchain_generate_issuance_map", nullptr,
/* description */ "A utility to help verify UIA distribution. Returns a snapshot map of all issuances for a particular UIA.",
/* returns */ "void",
/* params: */ {
{"symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"filename", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "A utility to help verify UIA distribution. Returns a snapshot map of all issuances for a particular UIA.\n\nParameters:\n symbol (string, required): the UIA for which to compute issuance map\n filename (string, required): filename to save snapshot to\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_generate_issuance_map_method_metadata);
}
{
// register method blockchain_calculate_supply
TiValue::api::MethodData blockchain_calculate_supply_method_metadata{"blockchain_calculate_supply", nullptr,
/* description */ "Calculate the total supply of an asset from the current blockchain database state",
/* returns */ "asset",
/* params: */ {
{"asset", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Calculate the total supply of an asset from the current blockchain database state\n\nParameters:\n asset (string, required): asset ticker symbol or ID to calculate supply for\n\nReturns:\n asset\n",
/* aliases */ {"supply", "calculate_supply"}, true};
store_method_metadata(blockchain_calculate_supply_method_metadata);
}
{
// register method blockchain_is_synced
TiValue::api::MethodData blockchain_is_synced_method_metadata{"blockchain_is_synced", nullptr,
/* description */ "Returns true if the local blockchain is synced with the network; false otherwise",
/* returns */ "bool",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns true if the local blockchain is synced with the network; false otherwise\n\nParameters:\n (none)\n\nReturns:\n bool\n",
/* aliases */ {"synced"}, false};
store_method_metadata(blockchain_is_synced_method_metadata);
}
{
// register method blockchain_get_block_count
TiValue::api::MethodData blockchain_get_block_count_method_metadata{"blockchain_get_block_count", nullptr,
/* description */ "Returns the current head block number",
/* returns */ "uint32_t",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns the current head block number\n\nParameters:\n (none)\n\nReturns:\n uint32_t\n",
/* aliases */ {"blockchain_get_blockcount", "getblockcount"}, true};
store_method_metadata(blockchain_get_block_count_method_metadata);
}
{
// register method blockchain_get_security_state
TiValue::api::MethodData blockchain_get_security_state_method_metadata{"blockchain_get_security_state", nullptr,
/* description */ "Returns information about blockchain security level",
/* returns */ "blockchain_security_state",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns information about blockchain security level\n\nParameters:\n (none)\n\nReturns:\n blockchain_security_state\n",
/* aliases */ {"alert_state", "security_state"}, true};
store_method_metadata(blockchain_get_security_state_method_metadata);
}
{
// register method blockchain_list_accounts
TiValue::api::MethodData blockchain_list_accounts_method_metadata{"blockchain_list_accounts", nullptr,
/* description */ "Returns registered accounts starting with a given name upto a the limit provided",
/* returns */ "account_entry_array",
/* params: */ {
{"first_account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"limit", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("20"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns registered accounts starting with a given name upto a the limit provided\n\nParameters:\n first_account_name (account_name, optional, defaults to \"\"): the first account name to include\n limit (uint32_t, optional, defaults to 20): the maximum number of items to list\n\nReturns:\n account_entry_array\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_list_accounts_method_metadata);
}
{
// register method blockchain_list_recently_updated_accounts
TiValue::api::MethodData blockchain_list_recently_updated_accounts_method_metadata{"blockchain_list_recently_updated_accounts", nullptr,
/* description */ "Returns a list of recently updated accounts",
/* returns */ "account_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns a list of recently updated accounts\n\nParameters:\n (none)\n\nReturns:\n account_entry_array\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_list_recently_updated_accounts_method_metadata);
}
{
// register method blockchain_list_recently_registered_accounts
TiValue::api::MethodData blockchain_list_recently_registered_accounts_method_metadata{"blockchain_list_recently_registered_accounts", nullptr,
/* description */ "Returns a list of recently registered accounts",
/* returns */ "account_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns a list of recently registered accounts\n\nParameters:\n (none)\n\nReturns:\n account_entry_array\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_list_recently_registered_accounts_method_metadata);
}
{
// register method blockchain_list_assets
TiValue::api::MethodData blockchain_list_assets_method_metadata{"blockchain_list_assets", nullptr,
/* description */ "Returns registered assets starting with a given name upto a the limit provided",
/* returns */ "asset_entry_array",
/* params: */ {
{"first_symbol", "asset_symbol", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"limit", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("20"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns registered assets starting with a given name upto a the limit provided\n\nParameters:\n first_symbol (asset_symbol, optional, defaults to \"\"): the prefix of the first asset symbol name to include\n limit (uint32_t, optional, defaults to 20): the maximum number of items to list\n\nReturns:\n asset_entry_array\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_list_assets_method_metadata);
}
{
// register method blockchain_list_pending_transactions
TiValue::api::MethodData blockchain_list_pending_transactions_method_metadata{"blockchain_list_pending_transactions", nullptr,
/* description */ "Return a list of transactions that are not yet in a block.",
/* returns */ "signed_transaction_pair_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Return a list of transactions that are not yet in a block.\n\nParameters:\n (none)\n\nReturns:\n signed_transaction_pair_array\n",
/* aliases */ {"blockchain_get_pending_transactions", "list_pending"}, false};
store_method_metadata(blockchain_list_pending_transactions_method_metadata);
}
{
// register method blockchain_get_transaction
TiValue::api::MethodData blockchain_get_transaction_method_metadata{"blockchain_get_transaction", nullptr,
/* description */ "Get detailed information about an in-wallet transaction",
/* returns */ "transaction_entry_pair",
/* params: */ {
{"transaction_id_prefix", "string", TiValue::api::required_positional, fc::ovariant()},
{"exact", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Get detailed information about an in-wallet transaction\n\nParameters:\n transaction_id_prefix (string, required): the base58 transaction ID to return\n exact (bool, optional, defaults to false): whether or not a partial match is ok\n\nReturns:\n transaction_entry_pair\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_transaction_method_metadata);
}
{
// register method blockchain_get_pretty_transaction
TiValue::api::MethodData blockchain_get_pretty_transaction_method_metadata{"blockchain_get_pretty_transaction", nullptr,
/* description */ "Get pretty information about an in-wallet transaction",
/* returns */ "pretty_transaction",
/* params: */ {
{"transaction_id_prefix", "string", TiValue::api::required_positional, fc::ovariant()},
{"exact", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Get pretty information about an in-wallet transaction\n\nParameters:\n transaction_id_prefix (string, required): the base16 transaction ID to return\n exact (bool, optional, defaults to false): whether or not a partial match is ok\n\nReturns:\n pretty_transaction\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_pretty_transaction_method_metadata);
}
{
// register method blockchain_get_pretty_contract_transaction
TiValue::api::MethodData blockchain_get_pretty_contract_transaction_method_metadata{"blockchain_get_pretty_contract_transaction", nullptr,
/* description */ "Get pretty information about an in-wallet contract transaction",
/* returns */ "pretty_contract_transaction",
/* params: */ {
{"transaction_id_prefix", "string", TiValue::api::required_positional, fc::ovariant()},
{"exact", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Get pretty information about an in-wallet contract transaction\n\nParameters:\n transaction_id_prefix (string, required): the base16 transaction ID to return\n exact (bool, optional, defaults to false): whether or not a partial match is ok\n\nReturns:\n pretty_contract_transaction\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_pretty_contract_transaction_method_metadata);
}
{
// register method blockchain_get_block
TiValue::api::MethodData blockchain_get_block_method_metadata{"blockchain_get_block", nullptr,
/* description */ "Retrieves the block entry for the given block number or ID",
/* returns */ "oblock_entry",
/* params: */ {
{"block", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Retrieves the block entry for the given block number or ID\n\nParameters:\n block (string, required): block number or ID to retrieve\n\nReturns:\n oblock_entry\n",
/* aliases */ {"get_block", "getblock", "blockchain_get_block_hash", "blockchain_get_blockhash", "getblockhash"}, true};
store_method_metadata(blockchain_get_block_method_metadata);
}
{
// register method blockchain_get_block_transactions
TiValue::api::MethodData blockchain_get_block_transactions_method_metadata{"blockchain_get_block_transactions", nullptr,
/* description */ "Retrieves the detailed transaction information for a block",
/* returns */ "transaction_entry_map",
/* params: */ {
{"block", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Retrieves the detailed transaction information for a block\n\nParameters:\n block (string, required): the number or id of the block to get transactions from\n\nReturns:\n transaction_entry_map\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_block_transactions_method_metadata);
}
{
// register method blockchain_get_account
TiValue::api::MethodData blockchain_get_account_method_metadata{"blockchain_get_account", nullptr,
/* description */ "Retrieves the entry for the given account name or ID",
/* returns */ "optional_account_entry",
/* params: */ {
{"account", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Retrieves the entry for the given account name or ID\n\nParameters:\n account (string, required): account name, ID, or public key to retrieve the entry for\n\nReturns:\n optional_account_entry\n",
/* aliases */ {"get_account"}, true};
store_method_metadata(blockchain_get_account_method_metadata);
}
{
// register method blockchain_get_slate
TiValue::api::MethodData blockchain_get_slate_method_metadata{"blockchain_get_slate", nullptr,
/* description */ "Retrieves a map of delegate IDs and names defined by the given slate ID or recommending account",
/* returns */ "map<account_id_type, string>",
/* params: */ {
{"slate", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Retrieves a map of delegate IDs and names defined by the given slate ID or recommending account\n\nParameters:\n slate (string, required): slate ID or recommending account name for which to retrieve the slate of delegates\n\nReturns:\n map<account_id_type, string>\n",
/* aliases */ {"get_slate"}, true};
store_method_metadata(blockchain_get_slate_method_metadata);
}
{
// register method blockchain_get_balance
TiValue::api::MethodData blockchain_get_balance_method_metadata{"blockchain_get_balance", nullptr,
/* description */ "Retrieves the specified balance entry",
/* returns */ "balance_entry",
/* params: */ {
{"balance_id", "address", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Retrieves the specified balance entry\n\nParameters:\n balance_id (address, required): the ID of the balance entry\n\nReturns:\n balance_entry\n",
/* aliases */ {"get_balance"}, true};
store_method_metadata(blockchain_get_balance_method_metadata);
}
{
// register method blockchain_list_balances
TiValue::api::MethodData blockchain_list_balances_method_metadata{"blockchain_list_balances", nullptr,
/* description */ "Lists balance entrys starting at the given balance ID",
/* returns */ "balance_entry_map",
/* params: */ {
{"first_balance_id", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"limit", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("20"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Lists balance entrys starting at the given balance ID\n\nParameters:\n first_balance_id (string, optional, defaults to \"\"): the first balance id to start at\n limit (uint32_t, optional, defaults to 20): the maximum number of items to list\n\nReturns:\n balance_entry_map\n",
/* aliases */ {"list_balances"}, true};
store_method_metadata(blockchain_list_balances_method_metadata);
}
{
// register method blockchain_list_address_balances
TiValue::api::MethodData blockchain_list_address_balances_method_metadata{"blockchain_list_address_balances", nullptr,
/* description */ "Lists balance entrys which are the balance IDs or which can be claimed by signature for this address",
/* returns */ "balance_entry_map",
/* params: */ {
{"addr", "string", TiValue::api::required_positional, fc::ovariant()},
{"chanced_since", "timestamp", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"1970-1-1T00:00:01\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Lists balance entrys which are the balance IDs or which can be claimed by signature for this address\n\nParameters:\n addr (string, required): address to scan for\n chanced_since (timestamp, optional, defaults to \"1970-1-1T00:00:01\"): Filter all balances that haven't chanced since the provided timestamp\n\nReturns:\n balance_entry_map\n",
/* aliases */ {"list_address_balances"}, true};
store_method_metadata(blockchain_list_address_balances_method_metadata);
}
{
// register method blockchain_list_address_transactions
TiValue::api::MethodData blockchain_list_address_transactions_method_metadata{"blockchain_list_address_transactions", nullptr,
/* description */ "Lists all transactions that involve the provided address after the specified time",
/* returns */ "variant_object",
/* params: */ {
{"addr", "string", TiValue::api::required_positional, fc::ovariant()},
{"filter_before", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"0\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Lists all transactions that involve the provided address after the specified time\n\nParameters:\n addr (string, required): address to scan for\n filter_before (uint32_t, optional, defaults to \"0\"): Filter all transactions that occured prior to the specified block number\n\nReturns:\n variant_object\n",
/* aliases */ {"list_address_transactions"}, true};
store_method_metadata(blockchain_list_address_transactions_method_metadata);
}
{
// register method blockchain_get_account_public_balance
TiValue::api::MethodData blockchain_get_account_public_balance_method_metadata{"blockchain_get_account_public_balance", nullptr,
/* description */ "Get the account entry for a given name",
/* returns */ "account_balance_summary_type",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get the account entry for a given name\n\nParameters:\n account_name (account_name, required): the name of the account whose public address you want\n\nReturns:\n account_balance_summary_type\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_account_public_balance_method_metadata);
}
{
// register method blockchain_list_key_balances
TiValue::api::MethodData blockchain_list_key_balances_method_metadata{"blockchain_list_key_balances", nullptr,
/* description */ "Lists balance entrys which can be claimed by signature for this key",
/* returns */ "balance_entry_map",
/* params: */ {
{"key", "public_key", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Lists balance entrys which can be claimed by signature for this key\n\nParameters:\n key (public_key, required): Key to scan for\n\nReturns:\n balance_entry_map\n",
/* aliases */ {"list_key_balances"}, true};
store_method_metadata(blockchain_list_key_balances_method_metadata);
}
{
// register method blockchain_get_asset
TiValue::api::MethodData blockchain_get_asset_method_metadata{"blockchain_get_asset", nullptr,
/* description */ "Retrieves the entry for the given asset ticker symbol or ID",
/* returns */ "optional_asset_entry",
/* params: */ {
{"asset", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Retrieves the entry for the given asset ticker symbol or ID\n\nParameters:\n asset (string, required): asset ticker symbol or ID to retrieve\n\nReturns:\n optional_asset_entry\n",
/* aliases */ {"get_asset"}, true};
store_method_metadata(blockchain_get_asset_method_metadata);
}
{
// register method blockchain_list_active_delegates
TiValue::api::MethodData blockchain_list_active_delegates_method_metadata{"blockchain_list_active_delegates", nullptr,
/* description */ "Returns a list of the current round's active delegates in signing order",
/* returns */ "account_entry_array",
/* params: */ {
{"first", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("0"))},
{"count", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("20"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns a list of the current round's active delegates in signing order\n\nParameters:\n first (uint32_t, optional, defaults to 0): \n count (uint32_t, optional, defaults to 20): \n\nReturns:\n account_entry_array\n",
/* aliases */ {"blockchain_get_active_delegates"}, true};
store_method_metadata(blockchain_list_active_delegates_method_metadata);
}
{
// register method blockchain_list_delegates
TiValue::api::MethodData blockchain_list_delegates_method_metadata{"blockchain_list_delegates", nullptr,
/* description */ "Returns a list of all the delegates sorted by vote",
/* returns */ "account_entry_array",
/* params: */ {
{"first", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("0"))},
{"count", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("20"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns a list of all the delegates sorted by vote\n\nParameters:\n first (uint32_t, optional, defaults to 0): \n count (uint32_t, optional, defaults to 20): \n\nReturns:\n account_entry_array\n",
/* aliases */ {"blockchain_get_delegates"}, true};
store_method_metadata(blockchain_list_delegates_method_metadata);
}
{
// register method blockchain_list_blocks
TiValue::api::MethodData blockchain_list_blocks_method_metadata{"blockchain_list_blocks", nullptr,
/* description */ "Returns a descending list of block entrys starting from the specified block number",
/* returns */ "block_entry_array",
/* params: */ {
{"max_block_num", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))},
{"limit", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("20"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns a descending list of block entrys starting from the specified block number\n\nParameters:\n max_block_num (uint32_t, optional, defaults to -1): the block num to start from; negative to count backwards from the current head block\n limit (uint32_t, optional, defaults to 20): max number of blocks to return\n\nReturns:\n block_entry_array\n",
/* aliases */ {"list_blocks"}, true};
store_method_metadata(blockchain_list_blocks_method_metadata);
}
{
// register method blockchain_list_missing_block_delegates
TiValue::api::MethodData blockchain_list_missing_block_delegates_method_metadata{"blockchain_list_missing_block_delegates", nullptr,
/* description */ "Returns any delegates who were supposed to produce a given block number but didn't",
/* returns */ "account_name_array",
/* params: */ {
{"block_number", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns any delegates who were supposed to produce a given block number but didn't\n\nParameters:\n block_number (uint32_t, required): The block to examine\n\nReturns:\n account_name_array\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_list_missing_block_delegates_method_metadata);
}
{
// register method blockchain_export_fork_graph
TiValue::api::MethodData blockchain_export_fork_graph_method_metadata{"blockchain_export_fork_graph", nullptr,
/* description */ "dumps the fork data to graphviz format",
/* returns */ "string",
/* params: */ {
{"start_block", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("1"))},
{"end_block", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))},
{"filename", "path", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "dumps the fork data to graphviz format\n\nParameters:\n start_block (uint32_t, optional, defaults to 1): the first block number to consider\n end_block (uint32_t, optional, defaults to -1): the last block number to consider\n filename (path, optional, defaults to \"\"): the filename to save to\n\nReturns:\n string\n",
/* aliases */ {"export_forks"}, false};
store_method_metadata(blockchain_export_fork_graph_method_metadata);
}
{
// register method blockchain_list_forks
TiValue::api::MethodData blockchain_list_forks_method_metadata{"blockchain_list_forks", nullptr,
/* description */ "returns a list of all blocks for which there is a fork off of the main chain",
/* returns */ "map<uint32_t, vector<fork_entry>>",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "returns a list of all blocks for which there is a fork off of the main chain\n\nParameters:\n (none)\n\nReturns:\n map<uint32_t, vector<fork_entry>>\n",
/* aliases */ {"list_forks"}, true};
store_method_metadata(blockchain_list_forks_method_metadata);
}
{
// register method blockchain_get_delegate_slot_entrys
TiValue::api::MethodData blockchain_get_delegate_slot_entrys_method_metadata{"blockchain_get_delegate_slot_entrys", nullptr,
/* description */ "Query the most recent block production slot entrys for the specified delegate",
/* returns */ "slot_entrys_list",
/* params: */ {
{"delegate_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"limit", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"10\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Query the most recent block production slot entrys for the specified delegate\n\nParameters:\n delegate_name (string, required): Delegate whose block production slot entrys to query\n limit (uint32_t, optional, defaults to \"10\"): The maximum number of slot entrys to return\n\nReturns:\n slot_entrys_list\n",
/* aliases */ {"get_slot"}, true};
store_method_metadata(blockchain_get_delegate_slot_entrys_method_metadata);
}
{
// register method blockchain_get_block_signee
TiValue::api::MethodData blockchain_get_block_signee_method_metadata{"blockchain_get_block_signee", nullptr,
/* description */ "Get the delegate that signed a given block",
/* returns */ "string",
/* params: */ {
{"block", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Get the delegate that signed a given block\n\nParameters:\n block (string, required): block number or ID to retrieve the signee for\n\nReturns:\n string\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_block_signee_method_metadata);
}
{
// register method blockchain_unclaimed_genesis
TiValue::api::MethodData blockchain_unclaimed_genesis_method_metadata{"blockchain_unclaimed_genesis", nullptr,
/* description */ "Returns the total shares in the genesis block which have never been fully or partially claimed.",
/* returns */ "asset",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns the total shares in the genesis block which have never been fully or partially claimed.\n\nParameters:\n (none)\n\nReturns:\n asset\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_unclaimed_genesis_method_metadata);
}
{
// register method blockchain_verify_signature
TiValue::api::MethodData blockchain_verify_signature_method_metadata{"blockchain_verify_signature", nullptr,
/* description */ "Verify that the given signature proves the given hash was signed by the given account.",
/* returns */ "bool",
/* params: */ {
{"signer", "string", TiValue::api::required_positional, fc::ovariant()},
{"hash", "sha256", TiValue::api::required_positional, fc::ovariant()},
{"signature", "compact_signature", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Verify that the given signature proves the given hash was signed by the given account.\n\nParameters:\n signer (string, required): A public key, address, or account name whose signature to check\n hash (sha256, required): The hash the signature claims to be for\n signature (compact_signature, required): A signature produced by wallet_sign_hash\n\nReturns:\n bool\n",
/* aliases */ {"verify_signature", "verify_sig", "blockchain_verify_sig"}, true};
store_method_metadata(blockchain_verify_signature_method_metadata);
}
{
// register method blockchain_dump_state
TiValue::api::MethodData blockchain_dump_state_method_metadata{"blockchain_dump_state", nullptr,
/* description */ "TODO",
/* returns */ "void",
/* params: */ {
{"path", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "TODO\n\nParameters:\n path (string, required): the directory to dump the state into\n\nReturns:\n void\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_dump_state_method_metadata);
}
{
// register method blockchain_broadcast_transaction
TiValue::api::MethodData blockchain_broadcast_transaction_method_metadata{"blockchain_broadcast_transaction", nullptr,
/* description */ "Takes a signed transaction and broadcasts it to the network.",
/* returns */ "void",
/* params: */ {
{"trx", "signed_transaction", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Takes a signed transaction and broadcasts it to the network.\n\nParameters:\n trx (signed_transaction, required): The transaction to broadcast\n\nReturns:\n void\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_broadcast_transaction_method_metadata);
}
{
// register method blockchain_btc_address_convert
TiValue::api::MethodData blockchain_btc_address_convert_method_metadata{"blockchain_btc_address_convert", nullptr,
/* description */ "Convert bitcoin address file to TiValue address file.",
/* returns */ "void",
/* params: */ {
{"path", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Convert bitcoin address file to TiValue address file.\n\nParameters:\n path (string, required): The bitcoin address file path.\n\nReturns:\n void\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_btc_address_convert_method_metadata);
}
{
// register method blockchain_get_transaction_rpc
TiValue::api::MethodData blockchain_get_transaction_rpc_method_metadata{"blockchain_get_transaction_rpc", nullptr,
/* description */ "Get detailed information about an in-wallet transaction",
/* returns */ "string",
/* params: */ {
{"transaction_id_prefix", "string", TiValue::api::required_positional, fc::ovariant()},
{"exact", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Get detailed information about an in-wallet transaction\n\nParameters:\n transaction_id_prefix (string, required): the base58 transaction ID to return\n exact (bool, optional, defaults to false): whether or not a partial match is ok\n\nReturns:\n string\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_transaction_rpc_method_metadata);
}
{
// register method blockchain_set_node_vm_enabled
TiValue::api::MethodData blockchain_set_node_vm_enabled_method_metadata{"blockchain_set_node_vm_enabled", nullptr,
/* description */ "set the vm enabled flag of normal node, no effect for the delegate",
/* returns */ "void",
/* params: */ {
{"enabled", "bool", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "set the vm enabled flag of normal node, no effect for the delegate\n\nParameters:\n enabled (bool, required): vm enabled flag\n\nReturns:\n void\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_set_node_vm_enabled_method_metadata);
}
{
// register method blockchain_get_node_vm_enabled
TiValue::api::MethodData blockchain_get_node_vm_enabled_method_metadata{"blockchain_get_node_vm_enabled", nullptr,
/* description */ "get the vm enabled flag of normal node",
/* returns */ "bool",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get the vm enabled flag of normal node\n\nParameters:\n (none)\n\nReturns:\n bool\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_node_vm_enabled_method_metadata);
}
{
// register method blockchain_get_all_contracts
TiValue::api::MethodData blockchain_get_all_contracts_method_metadata{"blockchain_get_all_contracts", nullptr,
/* description */ "get all contracts on the chain",
/* returns */ "contract_id_list",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get all contracts on the chain\n\nParameters:\n (none)\n\nReturns:\n contract_id_list\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_all_contracts_method_metadata);
}
{
// register method blockchain_get_forever_contracts
TiValue::api::MethodData blockchain_get_forever_contracts_method_metadata{"blockchain_get_forever_contracts", nullptr,
/* description */ "get all forever contracts on the chain",
/* returns */ "contract_id_name_map",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get all forever contracts on the chain\n\nParameters:\n (none)\n\nReturns:\n contract_id_name_map\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_get_forever_contracts_method_metadata);
}
{
// register method blockchain_list_pub_all_address
TiValue::api::MethodData blockchain_list_pub_all_address_method_metadata{"blockchain_list_pub_all_address", nullptr,
/* description */ "list all address converted by public",
/* returns */ "string_array",
/* params: */ {
{"pub_key", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "list all address converted by public\n\nParameters:\n pub_key (string, required): public key need to list all addresses\n\nReturns:\n string_array\n",
/* aliases */ {}, true};
store_method_metadata(blockchain_list_pub_all_address_method_metadata);
}
{
// register method network_add_node
TiValue::api::MethodData network_add_node_method_metadata{"network_add_node", nullptr,
/* description */ "Attempts add or remove <node> from the peer list or try a connection to <node> once",
/* returns */ "void",
/* params: */ {
{"node", "string", TiValue::api::required_positional, fc::ovariant()},
{"command", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"add\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Attempts add or remove <node> from the peer list or try a connection to <node> once\n\nParameters:\n node (string, required): The node (see network_get_peer_info for nodes)\n command (string, optional, defaults to \"add\"): 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\n\nReturns:\n void\n",
/* aliases */ {"addnode"}, false};
store_method_metadata(network_add_node_method_metadata);
}
{
// register method network_get_connection_count
TiValue::api::MethodData network_get_connection_count_method_metadata{"network_get_connection_count", nullptr,
/* description */ "Returns the number of fully-established connections to other nodes",
/* returns */ "uint32_t",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Returns the number of fully-established connections to other nodes\n\nParameters:\n (none)\n\nReturns:\n uint32_t\n",
/* aliases */ {"getconnectioncount"}, false};
store_method_metadata(network_get_connection_count_method_metadata);
}
{
// register method network_get_peer_info
TiValue::api::MethodData network_get_peer_info_method_metadata{"network_get_peer_info", nullptr,
/* description */ "Returns data about each connected node",
/* returns */ "json_object_array",
/* params: */ {
{"not_firewalled", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Returns data about each connected node\n\nParameters:\n not_firewalled (bool, optional, defaults to false): true to output only peers not behind a firewall and false otherwise\n\nReturns:\n json_object_array\n",
/* aliases */ {}, false};
store_method_metadata(network_get_peer_info_method_metadata);
}
{
// register method network_broadcast_transaction
TiValue::api::MethodData network_broadcast_transaction_method_metadata{"network_broadcast_transaction", nullptr,
/* description */ "Broadcast a previously-created signed transaction to the network",
/* returns */ "transaction_id",
/* params: */ {
{"transaction_to_broadcast", "signed_transaction", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 9,
/* detailed description */ "Broadcast a previously-created signed transaction to the network\n\nParameters:\n transaction_to_broadcast (signed_transaction, required): The transaction to broadcast to the network\n\nReturns:\n transaction_id\n",
/* aliases */ {}, false};
store_method_metadata(network_broadcast_transaction_method_metadata);
}
{
// register method network_set_advanced_node_parameters
TiValue::api::MethodData network_set_advanced_node_parameters_method_metadata{"network_set_advanced_node_parameters", nullptr,
/* description */ "Sets advanced node parameters, used for setting up automated tests",
/* returns */ "void",
/* params: */ {
{"params", "json_object", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Sets advanced node parameters, used for setting up automated tests\n\nParameters:\n params (json_object, required): A JSON object containing the name/value pairs for the parameters to set\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(network_set_advanced_node_parameters_method_metadata);
}
{
// register method network_get_advanced_node_parameters
TiValue::api::MethodData network_get_advanced_node_parameters_method_metadata{"network_get_advanced_node_parameters", nullptr,
/* description */ "Sets advanced node parameters, used for setting up automated tests",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Sets advanced node parameters, used for setting up automated tests\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {}, false};
store_method_metadata(network_get_advanced_node_parameters_method_metadata);
}
{
// register method network_get_transaction_propagation_data
TiValue::api::MethodData network_get_transaction_propagation_data_method_metadata{"network_get_transaction_propagation_data", nullptr,
/* description */ "Returns the time the transaction was first seen by this client",
/* returns */ "message_propagation_data",
/* params: */ {
{"transaction_id", "transaction_id", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Returns the time the transaction was first seen by this client\n\nThis interrogates the p2p node's message cache to find out when it first saw this transaction. The data in the message cache is only kept for a few blocks, so you can only use this to ask about recent transactions. This is intended to be used to track message propagation delays in our test network.\n\nParameters:\n transaction_id (transaction_id, required): the id of the transaction\n\nReturns:\n message_propagation_data\n",
/* aliases */ {}, false};
store_method_metadata(network_get_transaction_propagation_data_method_metadata);
}
{
// register method network_get_block_propagation_data
TiValue::api::MethodData network_get_block_propagation_data_method_metadata{"network_get_block_propagation_data", nullptr,
/* description */ "Returns the time the block was first seen by this client",
/* returns */ "message_propagation_data",
/* params: */ {
{"block_hash", "block_id_type", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Returns the time the block was first seen by this client\n\nThis interrogates the p2p node's message cache to find out when it first saw this block. The data in the message cache is only kept for a few blocks, so you can only use this to ask about recent transactions. This is intended to be used to track message propagation delays in our test network.\n\nParameters:\n block_hash (block_id_type, required): the id of the block\n\nReturns:\n message_propagation_data\n",
/* aliases */ {}, false};
store_method_metadata(network_get_block_propagation_data_method_metadata);
}
{
// register method network_get_info
TiValue::api::MethodData network_get_info_method_metadata{"network_get_info", nullptr,
/* description */ "Returns assorted information about the network settings and connections",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Returns assorted information about the network settings and connections\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {}, false};
store_method_metadata(network_get_info_method_metadata);
}
{
// register method network_list_potential_peers
TiValue::api::MethodData network_list_potential_peers_method_metadata{"network_list_potential_peers", nullptr,
/* description */ "Returns list of potential peers",
/* returns */ "potential_peer_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Returns list of potential peers\n\nParameters:\n (none)\n\nReturns:\n potential_peer_entry_array\n",
/* aliases */ {}, false};
store_method_metadata(network_list_potential_peers_method_metadata);
}
{
// register method network_get_upnp_info
TiValue::api::MethodData network_get_upnp_info_method_metadata{"network_get_upnp_info", nullptr,
/* description */ "Get information on UPNP status including whether it's enabled and what the client believes its IP to be",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Get information on UPNP status including whether it's enabled and what the client believes its IP to be\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {}, false};
store_method_metadata(network_get_upnp_info_method_metadata);
}
{
// register method network_get_blocked_ips
TiValue::api::MethodData network_get_blocked_ips_method_metadata{"network_get_blocked_ips", nullptr,
/* description */ "Get list of ips in blacklist",
/* returns */ "block_ip_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Get list of ips in blacklist\n\nParameters:\n (none)\n\nReturns:\n block_ip_array\n",
/* aliases */ {}, false};
store_method_metadata(network_get_blocked_ips_method_metadata);
}
{
// register method debug_get_client_name
TiValue::api::MethodData debug_get_client_name_method_metadata{"debug_get_client_name", nullptr,
/* description */ "Returns client's debug name specified in config.json",
/* returns */ "string",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns client's debug name specified in config.json\n\nParameters:\n (none)\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(debug_get_client_name_method_metadata);
}
{
// register method delegate_get_config
TiValue::api::MethodData delegate_get_config_method_metadata{"delegate_get_config", nullptr,
/* description */ "Returns current settings used during local block production",
/* returns */ "variant",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns current settings used during local block production\n\nParameters:\n (none)\n\nReturns:\n variant\n",
/* aliases */ {}, false};
store_method_metadata(delegate_get_config_method_metadata);
}
{
// register method delegate_set_network_min_connection_count
TiValue::api::MethodData delegate_set_network_min_connection_count_method_metadata{"delegate_set_network_min_connection_count", nullptr,
/* description */ "Set minimum network connection count required for block production",
/* returns */ "void",
/* params: */ {
{"count", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set minimum network connection count required for block production\n\nParameters:\n count (uint32_t, required): minimum network connection count\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_network_min_connection_count_method_metadata);
}
{
// register method delegate_set_block_max_transaction_count
TiValue::api::MethodData delegate_set_block_max_transaction_count_method_metadata{"delegate_set_block_max_transaction_count", nullptr,
/* description */ "Set maximum number of transactions allowed in a block",
/* returns */ "void",
/* params: */ {
{"count", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set maximum number of transactions allowed in a block\n\nParameters:\n count (uint32_t, required): maximum transaction count\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_block_max_transaction_count_method_metadata);
}
{
// register method delegate_set_soft_max_imessage_length
TiValue::api::MethodData delegate_set_soft_max_imessage_length_method_metadata{"delegate_set_soft_max_imessage_length", nullptr,
/* description */ "Set soft max length",
/* returns */ "void",
/* params: */ {
{"soft_length", "int64_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set soft max length\n\nParameters:\n soft_length (int64_t, required): soft max length\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_soft_max_imessage_length_method_metadata);
}
{
// register method delegate_set_imessage_fee_coe
TiValue::api::MethodData delegate_set_imessage_fee_coe_method_metadata{"delegate_set_imessage_fee_coe", nullptr,
/* description */ "Set fee coe",
/* returns */ "void",
/* params: */ {
{"fee_coe", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set fee coe\n\nParameters:\n fee_coe (string, required): imessage fee coe\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_imessage_fee_coe_method_metadata);
}
{
// register method delegate_set_block_max_size
TiValue::api::MethodData delegate_set_block_max_size_method_metadata{"delegate_set_block_max_size", nullptr,
/* description */ "Set maximum block size allowed",
/* returns */ "void",
/* params: */ {
{"size", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set maximum block size allowed\n\nParameters:\n size (uint32_t, required): maximum block size in bytes\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_block_max_size_method_metadata);
}
{
// register method delegate_set_transaction_max_size
TiValue::api::MethodData delegate_set_transaction_max_size_method_metadata{"delegate_set_transaction_max_size", nullptr,
/* description */ "Set maximum transaction size allowed",
/* returns */ "void",
/* params: */ {
{"size", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set maximum transaction size allowed\n\nParameters:\n size (uint32_t, required): maximum transaction size in bytes\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_transaction_max_size_method_metadata);
}
{
// register method delegate_set_transaction_canonical_signatures_required
TiValue::api::MethodData delegate_set_transaction_canonical_signatures_required_method_metadata{"delegate_set_transaction_canonical_signatures_required", nullptr,
/* description */ "Set whether canonical signatures are required",
/* returns */ "void",
/* params: */ {
{"required", "bool", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set whether canonical signatures are required\n\nParameters:\n required (bool, required): whether canonical signatures are required\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_transaction_canonical_signatures_required_method_metadata);
}
{
// register method delegate_set_transaction_min_fee
TiValue::api::MethodData delegate_set_transaction_min_fee_method_metadata{"delegate_set_transaction_min_fee", nullptr,
/* description */ "Set minimum transaction fee allowed",
/* returns */ "void",
/* params: */ {
{"fee", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Set minimum transaction fee allowed\n\nParameters:\n fee (string, required): minimum transaction fee in shares\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_set_transaction_min_fee_method_metadata);
}
{
// register method delegate_blacklist_add_transaction
TiValue::api::MethodData delegate_blacklist_add_transaction_method_metadata{"delegate_blacklist_add_transaction", nullptr,
/* description */ "Add specified transaction to blacklist",
/* returns */ "void",
/* params: */ {
{"id", "transaction_id", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Add specified transaction to blacklist\n\nParameters:\n id (transaction_id, required): transaction to add to blacklist\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_blacklist_add_transaction_method_metadata);
}
{
// register method delegate_blacklist_remove_transaction
TiValue::api::MethodData delegate_blacklist_remove_transaction_method_metadata{"delegate_blacklist_remove_transaction", nullptr,
/* description */ "Remove specified transaction from blacklist",
/* returns */ "void",
/* params: */ {
{"id", "transaction_id", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Remove specified transaction from blacklist\n\nParameters:\n id (transaction_id, required): transaction to remove from blacklist\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_blacklist_remove_transaction_method_metadata);
}
{
// register method delegate_blacklist_add_operation
TiValue::api::MethodData delegate_blacklist_add_operation_method_metadata{"delegate_blacklist_add_operation", nullptr,
/* description */ "Add specified operation to blacklist",
/* returns */ "void",
/* params: */ {
{"id", "operation_type", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Add specified operation to blacklist\n\nParameters:\n id (operation_type, required): operation to add to blacklist\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_blacklist_add_operation_method_metadata);
}
{
// register method delegate_blacklist_remove_operation
TiValue::api::MethodData delegate_blacklist_remove_operation_method_metadata{"delegate_blacklist_remove_operation", nullptr,
/* description */ "Remove specified operation from blacklist",
/* returns */ "void",
/* params: */ {
{"id", "operation_type", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Remove specified operation from blacklist\n\nParameters:\n id (operation_type, required): operation to remove from blacklist\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delegate_blacklist_remove_operation_method_metadata);
}
{
// register method wallet_get_info
TiValue::api::MethodData wallet_get_info_method_metadata{"wallet_get_info", nullptr,
/* description */ "Extra information about the wallet.",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Extra information about the wallet.\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_info_method_metadata);
}
{
// register method wallet_open
TiValue::api::MethodData wallet_open_method_metadata{"wallet_open", nullptr,
/* description */ "Opens the wallet of the given name",
/* returns */ "void",
/* params: */ {
{"wallet_name", "wallet_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Opens the wallet of the given name\n\nParameters:\n wallet_name (wallet_name, required): the name of the wallet to open\n\nReturns:\n void\n",
/* aliases */ {"open"}, false};
store_method_metadata(wallet_open_method_metadata);
}
{
// register method wallet_create
TiValue::api::MethodData wallet_create_method_metadata{"wallet_create", nullptr,
/* description */ "Creates a wallet with the given name",
/* returns */ "void",
/* params: */ {
{"wallet_name", "wallet_name", TiValue::api::required_positional, fc::ovariant()},
{"new_passphrase", "new_passphrase", TiValue::api::required_positional, fc::ovariant()},
{"brain_key", "brainkey", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Creates a wallet with the given name\n\nParameters:\n wallet_name (wallet_name, required): name of the wallet to create\n new_passphrase (new_passphrase, required): a passphrase for encrypting the wallet\n brain_key (brainkey, optional, defaults to \"\"): a strong passphrase that will be used to generate all private keys, defaults to a large random number\n\nReturns:\n void\n",
/* aliases */ {"create"}, false};
store_method_metadata(wallet_create_method_metadata);
}
{
// register method wallet_get_name
TiValue::api::MethodData wallet_get_name_method_metadata{"wallet_get_name", nullptr,
/* description */ "Returns the wallet name passed to wallet_open",
/* returns */ "optional_wallet_name",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns the wallet name passed to wallet_open\n\nParameters:\n (none)\n\nReturns:\n optional_wallet_name\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_name_method_metadata);
}
{
// register method wallet_import_private_key
TiValue::api::MethodData wallet_import_private_key_method_metadata{"wallet_import_private_key", nullptr,
/* description */ "Loads the private key into the specified account. Returns which account it was actually imported to.",
/* returns */ "account_name",
/* params: */ {
{"wif_key", "wif_private_key", TiValue::api::required_positional, fc::ovariant()},
{"account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("null"))},
{"create_new_account", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))},
{"rescan", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Loads the private key into the specified account. Returns which account it was actually imported to.\n\nParameters:\n wif_key (wif_private_key, required): A private key in bitcoin Wallet Import Format (WIF)\n account_name (account_name, optional, defaults to null): the name of the account the key should be imported into, if null then the key must belong to an active account\n create_new_account (bool, optional, defaults to false): If true, the wallet will attempt to create a new account for the name provided rather than import the key into an existing account\n rescan (bool, optional, defaults to false): If true, the wallet will rescan the blockchain looking for transactions that involve this private key\n\nReturns:\n account_name\n",
/* aliases */ {"import_key", "importprivkey"}, false};
store_method_metadata(wallet_import_private_key_method_metadata);
}
{
// register method wallet_close
TiValue::api::MethodData wallet_close_method_metadata{"wallet_close", nullptr,
/* description */ "Closes the curent wallet if one is open",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Closes the curent wallet if one is open\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {"close"}, false};
store_method_metadata(wallet_close_method_metadata);
}
{
// register method wallet_backup_create
TiValue::api::MethodData wallet_backup_create_method_metadata{"wallet_backup_create", nullptr,
/* description */ "Exports the current wallet to a JSON file",
/* returns */ "void",
/* params: */ {
{"json_filename", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Exports the current wallet to a JSON file\n\nParameters:\n json_filename (filename, required): the full path and filename of JSON file to generate\n\nReturns:\n void\n",
/* aliases */ {"backupwallet", "wallet_export_to_json"}, false};
store_method_metadata(wallet_backup_create_method_metadata);
}
{
// register method wallet_backup_restore
TiValue::api::MethodData wallet_backup_restore_method_metadata{"wallet_backup_restore", nullptr,
/* description */ "Creates a new wallet from an exported JSON file",
/* returns */ "void",
/* params: */ {
{"json_filename", "filename", TiValue::api::required_positional, fc::ovariant()},
{"wallet_name", "wallet_name", TiValue::api::required_positional, fc::ovariant()},
{"imported_wallet_passphrase", "passphrase", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Creates a new wallet from an exported JSON file\n\nParameters:\n json_filename (filename, required): the full path and filename of JSON wallet to import\n wallet_name (wallet_name, required): name of the wallet to create\n imported_wallet_passphrase (passphrase, required): passphrase of the imported wallet\n\nReturns:\n void\n",
/* aliases */ {"wallet_create_from_json"}, false};
store_method_metadata(wallet_backup_restore_method_metadata);
}
{
// register method wallet_set_automatic_backups
TiValue::api::MethodData wallet_set_automatic_backups_method_metadata{"wallet_set_automatic_backups", nullptr,
/* description */ "Enables or disables automatic wallet backups",
/* returns */ "bool",
/* params: */ {
{"enabled", "bool", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Enables or disables automatic wallet backups\n\nParameters:\n enabled (bool, required): true to enable and false to disable\n\nReturns:\n bool\n",
/* aliases */ {"auto_backup", "autobackup"}, false};
store_method_metadata(wallet_set_automatic_backups_method_metadata);
}
{
// register method wallet_set_transaction_expiration_time
TiValue::api::MethodData wallet_set_transaction_expiration_time_method_metadata{"wallet_set_transaction_expiration_time", nullptr,
/* description */ "Set transaction expiration time",
/* returns */ "uint32_t",
/* params: */ {
{"seconds", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Set transaction expiration time\n\nParameters:\n seconds (uint32_t, required): seconds before new transactions expire\n\nReturns:\n uint32_t\n",
/* aliases */ {"set_expiration"}, false};
store_method_metadata(wallet_set_transaction_expiration_time_method_metadata);
}
{
// register method wallet_account_transaction_history
TiValue::api::MethodData wallet_account_transaction_history_method_metadata{"wallet_account_transaction_history", nullptr,
/* description */ "Lists transaction history for the specified account",
/* returns */ "pretty_transactions",
/* params: */ {
{"account_name", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"asset_symbol", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"limit", "int32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("0"))},
{"start_block_num", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("0"))},
{"end_block_num", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists transaction history for the specified account\n\nParameters:\n account_name (string, optional, defaults to \"\"): the name of the account for which the transaction history will be returned, \"\" for all accounts\n asset_symbol (string, optional, defaults to \"\"): only include transactions involving the specified asset, or \"\" to include all\n limit (int32_t, optional, defaults to 0): limit the number of returned transactions; negative for most recent and positive for least recent. 0 does not limit\n start_block_num (uint32_t, optional, defaults to 0): the earliest block number to list transactions from; 0 to include all transactions starting from genesis\n end_block_num (uint32_t, optional, defaults to -1): the latest block to list transaction from; -1 to include all transactions ending at the head block\n\nReturns:\n pretty_transactions\n",
/* aliases */ {"history", "listtransactions"}, false};
store_method_metadata(wallet_account_transaction_history_method_metadata);
}
{
// register method wallet_transaction_history_splite
TiValue::api::MethodData wallet_transaction_history_splite_method_metadata{"wallet_transaction_history_splite", nullptr,
/* description */ "Lists transaction history for the specified account",
/* returns */ "pretty_transactions",
/* params: */ {
{"account_name", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"asset_symbol", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"limit", "int32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("0"))},
{"transaction_type", "int32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"2\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists transaction history for the specified account\n\nParameters:\n account_name (string, optional, defaults to \"\"): the name of the account for which the transaction history will be returned, \"\" for all accounts\n asset_symbol (string, optional, defaults to \"\"): only include transactions involving the specified asset, or \"\" to include all\n limit (int32_t, optional, defaults to 0): limit the number of returned transactions; negative for most recent and positive for least recent. 0 does not limit\n transaction_type (int32_t, optional, defaults to \"2\"): transaction type\n\nReturns:\n pretty_transactions\n",
/* aliases */ {}, false};
store_method_metadata(wallet_transaction_history_splite_method_metadata);
}
{
// register method wallet_account_historic_balance
TiValue::api::MethodData wallet_account_historic_balance_method_metadata{"wallet_account_historic_balance", nullptr,
/* description */ "Lists wallet's balance at the given time",
/* returns */ "account_balance_summary_type",
/* params: */ {
{"time", "timestamp", TiValue::api::required_positional, fc::ovariant()},
{"account_name", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists wallet's balance at the given time\n\nParameters:\n time (timestamp, required): the date and time for which the balance will be computed\n account_name (string, optional, defaults to \"\"): the name of the account for which the historic balance will be returned, \"\" for all accounts\n\nReturns:\n account_balance_summary_type\n",
/* aliases */ {}, false};
store_method_metadata(wallet_account_historic_balance_method_metadata);
}
{
// register method wallet_remove_transaction
TiValue::api::MethodData wallet_remove_transaction_method_metadata{"wallet_remove_transaction", nullptr,
/* description */ "Removes the specified transaction entry from your transaction history. USE WITH CAUTION! Rescan cannot reconstruct all transaction details",
/* returns */ "void",
/* params: */ {
{"transaction_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Removes the specified transaction entry from your transaction history. USE WITH CAUTION! Rescan cannot reconstruct all transaction details\n\nParameters:\n transaction_id (string, required): the id (or id prefix) of the transaction entry\n\nReturns:\n void\n",
/* aliases */ {"remove_transaction", "wallet_transaction_remove"}, false};
store_method_metadata(wallet_remove_transaction_method_metadata);
}
{
// register method wallet_get_pending_transaction_errors
TiValue::api::MethodData wallet_get_pending_transaction_errors_method_metadata{"wallet_get_pending_transaction_errors", nullptr,
/* description */ "Return any errors for your currently pending transactions",
/* returns */ "map<transaction_id_type, fc::exception>",
/* params: */ {
{"filename", "path", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Return any errors for your currently pending transactions\n\nParameters:\n filename (path, optional, defaults to \"\"): filename to save pending transaction errors to\n\nReturns:\n map<transaction_id_type, fc::exception>\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_pending_transaction_errors_method_metadata);
}
{
// register method wallet_lock
TiValue::api::MethodData wallet_lock_method_metadata{"wallet_lock", nullptr,
/* description */ "Lock the private keys in wallet, disables spending commands until unlocked",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lock the private keys in wallet, disables spending commands until unlocked\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {"lock"}, false};
store_method_metadata(wallet_lock_method_metadata);
}
{
// register method wallet_unlock
TiValue::api::MethodData wallet_unlock_method_metadata{"wallet_unlock", nullptr,
/* description */ "Unlock the private keys in the wallet to enable spending operations",
/* returns */ "void",
/* params: */ {
{"timeout", "uint32_t", TiValue::api::required_positional, fc::ovariant()},
{"passphrase", "passphrase", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Unlock the private keys in the wallet to enable spending operations\n\nParameters:\n timeout (uint32_t, required): the number of seconds to keep the wallet unlocked\n passphrase (passphrase, required): the passphrase for encrypting the wallet\n\nReturns:\n void\n",
/* aliases */ {"unlock", "walletpassphrase"}, false};
store_method_metadata(wallet_unlock_method_metadata);
}
{
// register method wallet_change_passphrase
TiValue::api::MethodData wallet_change_passphrase_method_metadata{"wallet_change_passphrase", nullptr,
/* description */ "Change the password of the current wallet",
/* returns */ "void",
/* params: */ {
{"old_passphrase", "passphrase", TiValue::api::required_positional, fc::ovariant()},
{"passphrase", "passphrase", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Change the password of the current wallet\n\nThis will change the wallet's spending passphrase, please make sure you remember it.\n\nParameters:\n old_passphrase (passphrase, required): the old passphrase for this wallet\n passphrase (passphrase, required): the passphrase for encrypting the wallet\n\nReturns:\n void\n",
/* aliases */ {"walletpassphrasechange"}, false};
store_method_metadata(wallet_change_passphrase_method_metadata);
}
{
// register method wallet_check_passphrase
TiValue::api::MethodData wallet_check_passphrase_method_metadata{"wallet_check_passphrase", nullptr,
/* description */ "check the password of the current wallet",
/* returns */ "bool",
/* params: */ {
{"passphrase", "passphrase", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "check the password of the current wallet\n\nThis will check the wallet's spending passphrase.\n\nParameters:\n passphrase (passphrase, required): the passphrase to be checking\n\nReturns:\n bool\n",
/* aliases */ {"check_passphrase", "check_password"}, false};
store_method_metadata(wallet_check_passphrase_method_metadata);
}
{
// register method wallet_check_address
TiValue::api::MethodData wallet_check_address_method_metadata{"wallet_check_address", nullptr,
/* description */ "check address is valid address or an acount name.",
/* returns */ "bool",
/* params: */ {
{"address", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "check address is valid address or an acount name.\n\nThis will check the address.\n\nParameters:\n address (string, required): the address/accountname to be checking (string, required)\n\nReturns:\n bool\n",
/* aliases */ {"check_address"}, false};
store_method_metadata(wallet_check_address_method_metadata);
}
{
// register method wallet_list
TiValue::api::MethodData wallet_list_method_metadata{"wallet_list", nullptr,
/* description */ "Return a list of wallets in the current data directory",
/* returns */ "wallet_name_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Return a list of wallets in the current data directory\n\nParameters:\n (none)\n\nReturns:\n wallet_name_array\n",
/* aliases */ {}, false};
store_method_metadata(wallet_list_method_metadata);
}
{
// register method wallet_account_create
TiValue::api::MethodData wallet_account_create_method_metadata{"wallet_account_create", nullptr,
/* description */ "Add new account for receiving payments",
/* returns */ "address",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"private_data", "json_variant", TiValue::api::optional_positional, fc::variant(fc::json::from_string("null"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Add new account for receiving payments\n\nParameters:\n account_name (account_name, required): the name you will use to refer to this receive account\n private_data (json_variant, optional, defaults to null): Extra data to store with this account entry\n\nReturns:\n address\n",
/* aliases */ {"wallet_create_account", "create_account"}, false};
store_method_metadata(wallet_account_create_method_metadata);
}
{
// register method wallet_account_set_approval
TiValue::api::MethodData wallet_account_set_approval_method_metadata{"wallet_account_set_approval", nullptr,
/* description */ "Updates your approval of the specified account",
/* returns */ "int8_t",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"approval", "int8_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("1"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Updates your approval of the specified account\n\nParameters:\n account_name (account_name, required): the name of the account to set approval for\n approval (int8_t, optional, defaults to 1): 1, 0, or -1 respectively for approve, neutral, or disapprove\n\nReturns:\n int8_t\n",
/* aliases */ {"approve", "set_approval", "wallet_approve_delegate", "wallet_approve"}, false};
store_method_metadata(wallet_account_set_approval_method_metadata);
}
{
// register method wallet_get_all_approved_accounts
TiValue::api::MethodData wallet_get_all_approved_accounts_method_metadata{"wallet_get_all_approved_accounts", nullptr,
/* description */ "Return all approved account entrys",
/* returns */ "account_entry_array",
/* params: */ {
{"approval", "int8_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("1"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Return all approved account entrys\n\nParameters:\n approval (int8_t, optional, defaults to 1): 1, 0, or -1 respectively for approve, neutral, or disapprove\n\nReturns:\n account_entry_array\n",
/* aliases */ {"all_approved_accounts", "approved_accounts"}, false};
store_method_metadata(wallet_get_all_approved_accounts_method_metadata);
}
{
// register method wallet_address_create
TiValue::api::MethodData wallet_address_create_method_metadata{"wallet_address_create", nullptr,
/* description */ "Creates an address which can be used for a simple (non-TITAN) transfer.",
/* returns */ "string",
/* params: */ {
{"account_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"label", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"legacy_network_byte", "int32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Creates an address which can be used for a simple (non-TITAN) transfer.\n\nParameters:\n account_name (string, required): The account name that will own this address\n label (string, optional, defaults to \"\"): \n legacy_network_byte (int32_t, optional, defaults to -1): If not -1, use this as the network byte for a BTC-style address.\n\nReturns:\n string\n",
/* aliases */ {"new_address"}, false};
store_method_metadata(wallet_address_create_method_metadata);
}
{
// register method wallet_transfer_to_address
TiValue::api::MethodData wallet_transfer_to_address_method_metadata{"wallet_transfer_to_address", nullptr,
/* description */ "Do a simple (non-TITAN) transfer to an address",
/* returns */ "transaction_entry",
/* params: */ {
{"amount_to_transfer", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"memo_message", "information", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"strategy", "vote_strategy", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"vote_recommended\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Do a simple (non-TITAN) transfer to an address\n\nParameters:\n amount_to_transfer (string, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (account_name, required): the source account to draw the shares from\n to_address (string, required): the address or pubkey to transfer to\n memo_message (information, optional, defaults to \"\"): a memo to store with the transaction\n strategy (vote_strategy, optional, defaults to \"vote_recommended\"): enumeration [vote_none | vote_all | vote_random | vote_recommended] \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_transfer_to_address_method_metadata);
}
{
// register method wallet_transfer_to_public_account
TiValue::api::MethodData wallet_transfer_to_public_account_method_metadata{"wallet_transfer_to_public_account", nullptr,
/* description */ "Sends given amount to the given account",
/* returns */ "transaction_entry",
/* params: */ {
{"amount_to_transfer", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "sending_account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_account_name", "receive_account_name", TiValue::api::required_positional, fc::ovariant()},
{"memo_message", "information", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"strategy", "vote_strategy", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"vote_recommended\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Sends given amount to the given account\n\nParameters:\n amount_to_transfer (string, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (sending_account_name, required): the source account to draw the shares from\n to_account_name (receive_account_name, required): the account to transfer the shares to\n memo_message (information, optional, defaults to \"\"): a memo to store with the transaction\n strategy (vote_strategy, optional, defaults to \"vote_recommended\"): enumeration [vote_none | vote_all | vote_random | vote_recommended] \n\nReturns:\n transaction_entry\n",
/* aliases */ {"transfer_public"}, false};
store_method_metadata(wallet_transfer_to_public_account_method_metadata);
}
{
// register method wallet_withdraw_from_address
TiValue::api::MethodData wallet_withdraw_from_address_method_metadata{"wallet_withdraw_from_address", nullptr,
/* description */ "",
/* returns */ "transaction_builder",
/* params: */ {
{"amount", "string", TiValue::api::required_positional, fc::ovariant()},
{"symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"from_address", "address", TiValue::api::required_positional, fc::ovariant()},
{"to", "string", TiValue::api::required_positional, fc::ovariant()},
{"strategy", "vote_strategy", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"vote_none\""))},
{"sign_and_broadcast", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("true"))},
{"builder_path", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "\n\nParameters:\n amount (string, required): how much to transfer\n symbol (string, required): which asset\n from_address (address, required): the balance address to withdraw from\n to (string, required): address or account to receive funds\n strategy (vote_strategy, optional, defaults to \"vote_none\"): enumeration [vote_none | vote_all | vote_random | vote_recommended] \n sign_and_broadcast (bool, optional, defaults to true): \n builder_path (string, optional, defaults to \"\"): If specified, will write builder here instead of to DATA_DIR/transactions/latest.trx\n\nReturns:\n transaction_builder\n",
/* aliases */ {"withdraw_from_address"}, false};
store_method_metadata(wallet_withdraw_from_address_method_metadata);
}
{
// register method wallet_rescan_blockchain
TiValue::api::MethodData wallet_rescan_blockchain_method_metadata{"wallet_rescan_blockchain", nullptr,
/* description */ "Scans the blockchain history for operations relevant to this wallet.",
/* returns */ "void",
/* params: */ {
{"start_block_num", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("0"))},
{"limit", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Scans the blockchain history for operations relevant to this wallet.\n\nParameters:\n start_block_num (uint32_t, optional, defaults to 0): the first block to scan\n limit (uint32_t, optional, defaults to -1): the maximum number of blocks to scan\n\nReturns:\n void\n",
/* aliases */ {"scan", "rescan"}, false};
store_method_metadata(wallet_rescan_blockchain_method_metadata);
}
{
// register method wallet_cancel_scan
TiValue::api::MethodData wallet_cancel_scan_method_metadata{"wallet_cancel_scan", nullptr,
/* description */ "Cancel any current scan task",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Cancel any current scan task\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_cancel_scan_method_metadata);
}
{
// register method wallet_get_transaction
TiValue::api::MethodData wallet_get_transaction_method_metadata{"wallet_get_transaction", nullptr,
/* description */ "Queries your wallet for the specified transaction",
/* returns */ "transaction_entry",
/* params: */ {
{"transaction_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Queries your wallet for the specified transaction\n\nParameters:\n transaction_id (string, required): the id (or id prefix) of the transaction\n\nReturns:\n transaction_entry\n",
/* aliases */ {"get_transaction"}, false};
store_method_metadata(wallet_get_transaction_method_metadata);
}
{
// register method wallet_scan_transaction
TiValue::api::MethodData wallet_scan_transaction_method_metadata{"wallet_scan_transaction", nullptr,
/* description */ "Scans the specified transaction",
/* returns */ "transaction_entry",
/* params: */ {
{"transaction_id", "string", TiValue::api::required_positional, fc::ovariant()},
{"overwrite_existing", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Scans the specified transaction\n\nParameters:\n transaction_id (string, required): the id (or id prefix) of the transaction\n overwrite_existing (bool, optional, defaults to false): true to overwrite existing wallet transaction entry and false otherwise\n\nReturns:\n transaction_entry\n",
/* aliases */ {"scan_transaction", "wallet_transaction_scan"}, false};
store_method_metadata(wallet_scan_transaction_method_metadata);
}
{
// register method wallet_rebroadcast_transaction
TiValue::api::MethodData wallet_rebroadcast_transaction_method_metadata{"wallet_rebroadcast_transaction", nullptr,
/* description */ "Rebroadcasts the specified transaction",
/* returns */ "void",
/* params: */ {
{"transaction_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Rebroadcasts the specified transaction\n\nParameters:\n transaction_id (string, required): the id (or id prefix) of the transaction\n\nReturns:\n void\n",
/* aliases */ {"rebroadcast", "wallet_transaction_rebroadcast"}, false};
store_method_metadata(wallet_rebroadcast_transaction_method_metadata);
}
{
// register method wallet_account_register
TiValue::api::MethodData wallet_account_register_method_metadata{"wallet_account_register", nullptr,
/* description */ "Updates the data published about a given account",
/* returns */ "transaction_entry",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"pay_from_account", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"public_data", "json_variant", TiValue::api::optional_positional, fc::variant(fc::json::from_string("null"))},
{"delegate_pay_rate", "uint8_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))},
{"account_type", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"titan_account\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Updates the data published about a given account\n\nParameters:\n account_name (account_name, required): the account that will be updated\n pay_from_account (account_name, required): the account from which fees will be paid\n public_data (json_variant, optional, defaults to null): public data about the account\n delegate_pay_rate (uint8_t, optional, defaults to -1): -1 for non-delegates; otherwise the percent of delegate pay to accept per produced block\n account_type (string, optional, defaults to \"titan_account\"): titan_account | public_account - public accounts do not receive memos and all payments are made to the active key\n\nReturns:\n transaction_entry\n",
/* aliases */ {"register"}, false};
store_method_metadata(wallet_account_register_method_metadata);
}
{
// register method wallet_account_update_private_data
TiValue::api::MethodData wallet_account_update_private_data_method_metadata{"wallet_account_update_private_data", nullptr,
/* description */ "Updates the local private data for an account",
/* returns */ "void",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"private_data", "json_variant", TiValue::api::optional_positional, fc::variant(fc::json::from_string("null"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Updates the local private data for an account\n\nParameters:\n account_name (account_name, required): the account that will be updated\n private_data (json_variant, optional, defaults to null): private data about the account\n\nReturns:\n void\n",
/* aliases */ {"update_private_data"}, false};
store_method_metadata(wallet_account_update_private_data_method_metadata);
}
{
// register method wallet_account_update_registration
TiValue::api::MethodData wallet_account_update_registration_method_metadata{"wallet_account_update_registration", nullptr,
/* description */ "Updates the data published about a given account",
/* returns */ "transaction_entry",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"pay_from_account", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"public_data", "json_variant", TiValue::api::optional_positional, fc::variant(fc::json::from_string("null"))},
{"delegate_pay_rate", "uint8_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("-1"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Updates the data published about a given account\n\nParameters:\n account_name (account_name, required): the account that will be updated\n pay_from_account (account_name, required): the account from which fees will be paid\n public_data (json_variant, optional, defaults to null): public data about the account\n delegate_pay_rate (uint8_t, optional, defaults to -1): -1 for non-delegates; otherwise the percent of delegate pay to accept per produced block\n\nReturns:\n transaction_entry\n",
/* aliases */ {"update_registration"}, false};
store_method_metadata(wallet_account_update_registration_method_metadata);
}
{
// register method wallet_account_update_active_key
TiValue::api::MethodData wallet_account_update_active_key_method_metadata{"wallet_account_update_active_key", nullptr,
/* description */ "Updates the specified account's active key and broadcasts the transaction.",
/* returns */ "transaction_entry",
/* params: */ {
{"account_to_update", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"pay_from_account", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"new_active_key", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Updates the specified account's active key and broadcasts the transaction.\n\nParameters:\n account_to_update (account_name, required): The name of the account to update the active key of.\n pay_from_account (account_name, required): The account from which fees will be paid.\n new_active_key (string, optional, defaults to \"\"): WIF private key to update active key to. If empty, a new key will be generated.\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_account_update_active_key_method_metadata);
}
{
// register method wallet_list_accounts
TiValue::api::MethodData wallet_list_accounts_method_metadata{"wallet_list_accounts", nullptr,
/* description */ "Lists all accounts associated with this wallet",
/* returns */ "wallet_account_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists all accounts associated with this wallet\n\nParameters:\n (none)\n\nReturns:\n wallet_account_entry_array\n",
/* aliases */ {"listaccounts"}, false};
store_method_metadata(wallet_list_accounts_method_metadata);
}
{
// register method wallet_list_unregistered_accounts
TiValue::api::MethodData wallet_list_unregistered_accounts_method_metadata{"wallet_list_unregistered_accounts", nullptr,
/* description */ "Lists all unregistered accounts belonging to this wallet",
/* returns */ "wallet_account_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists all unregistered accounts belonging to this wallet\n\nParameters:\n (none)\n\nReturns:\n wallet_account_entry_array\n",
/* aliases */ {}, false};
store_method_metadata(wallet_list_unregistered_accounts_method_metadata);
}
{
// register method wallet_list_my_accounts
TiValue::api::MethodData wallet_list_my_accounts_method_metadata{"wallet_list_my_accounts", nullptr,
/* description */ "Lists all accounts for which we have a private key in this wallet",
/* returns */ "wallet_account_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists all accounts for which we have a private key in this wallet\n\nParameters:\n (none)\n\nReturns:\n wallet_account_entry_array\n",
/* aliases */ {}, false};
store_method_metadata(wallet_list_my_accounts_method_metadata);
}
{
// register method wallet_list_my_addresses
TiValue::api::MethodData wallet_list_my_addresses_method_metadata{"wallet_list_my_addresses", nullptr,
/* description */ "Lists all accounts and account addresses for which we have a private key in this wallet",
/* returns */ "account_address_entry_array",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists all accounts and account addresses for which we have a private key in this wallet\n\nParameters:\n (none)\n\nReturns:\n account_address_entry_array\n",
/* aliases */ {}, false};
store_method_metadata(wallet_list_my_addresses_method_metadata);
}
{
// register method wallet_get_account
TiValue::api::MethodData wallet_get_account_method_metadata{"wallet_get_account", nullptr,
/* description */ "Get the account entry for a given name",
/* returns */ "wallet_account_entry",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get the account entry for a given name\n\nParameters:\n account_name (account_name, required): the name of the account to retrieve\n\nReturns:\n wallet_account_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_account_method_metadata);
}
{
// register method wallet_get_account_public_address
TiValue::api::MethodData wallet_get_account_public_address_method_metadata{"wallet_get_account_public_address", nullptr,
/* description */ "Get the account entry for a given name",
/* returns */ "string",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get the account entry for a given name\n\nParameters:\n account_name (account_name, required): the name of the account whose public address you want\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_account_public_address_method_metadata);
}
{
// register method wallet_remove_contact_account
TiValue::api::MethodData wallet_remove_contact_account_method_metadata{"wallet_remove_contact_account", nullptr,
/* description */ "Remove a contact account from your wallet",
/* returns */ "void",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Remove a contact account from your wallet\n\nParameters:\n account_name (account_name, required): the name of the contact\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_remove_contact_account_method_metadata);
}
{
// register method wallet_account_rename
TiValue::api::MethodData wallet_account_rename_method_metadata{"wallet_account_rename", nullptr,
/* description */ "Rename an account in wallet",
/* returns */ "void",
/* params: */ {
{"current_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"new_account_name", "new_account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Rename an account in wallet\n\nParameters:\n current_account_name (account_name, required): the current name of the account\n new_account_name (new_account_name, required): the new name for the account\n\nReturns:\n void\n",
/* aliases */ {"wallet_rename_account"}, false};
store_method_metadata(wallet_account_rename_method_metadata);
}
{
// register method wallet_asset_create
TiValue::api::MethodData wallet_asset_create_method_metadata{"wallet_asset_create", nullptr,
/* description */ "Creates a new user issued asset",
/* returns */ "transaction_entry",
/* params: */ {
{"symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"asset_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"issuer_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"description", "string", TiValue::api::required_positional, fc::ovariant()},
{"maximum_share_supply", "string", TiValue::api::required_positional, fc::ovariant()},
{"precision", "uint64_t", TiValue::api::required_positional, fc::ovariant()},
{"public_data", "json_variant", TiValue::api::optional_positional, fc::variant(fc::json::from_string("null"))},
{"is_market_issued", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("false"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Creates a new user issued asset\n\nParameters:\n symbol (asset_symbol, required): the ticker symbol for the new asset\n asset_name (string, required): the name of the asset\n issuer_name (string, required): the name of the issuer of the asset\n description (string, required): a description of the asset\n maximum_share_supply (string, required): the maximum number of shares of the asset\n precision (uint64_t, required): defines where the decimal should be displayed, must be a power of 10\n public_data (json_variant, optional, defaults to null): arbitrary data attached to the asset\n is_market_issued (bool, optional, defaults to false): creation of a new BitAsset that is created by shorting\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_asset_create_method_metadata);
}
{
// register method wallet_asset_issue
TiValue::api::MethodData wallet_asset_issue_method_metadata{"wallet_asset_issue", nullptr,
/* description */ "Issues new shares of a given asset type",
/* returns */ "transaction_entry",
/* params: */ {
{"amount", "string", TiValue::api::required_positional, fc::ovariant()},
{"symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"to_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"memo_message", "information", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Issues new shares of a given asset type\n\nThe asset being issued must have been created via wallet_asset_create in a previous block.\n\nParameters:\n amount (string, required): the amount of shares to issue\n symbol (asset_symbol, required): the ticker symbol for asset\n to_account_name (account_name, required): the name of the account to receive the shares\n memo_message (information, optional, defaults to \"\"): the memo to send to the receiver\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_asset_issue_method_metadata);
}
{
// register method wallet_asset_issue_to_addresses
TiValue::api::MethodData wallet_asset_issue_to_addresses_method_metadata{"wallet_asset_issue_to_addresses", nullptr,
/* description */ "Issues new UIA shares to specific addresses.",
/* returns */ "transaction_entry",
/* params: */ {
{"symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"addresses", "snapshot_map", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Issues new UIA shares to specific addresses.\n\nThis is intended to be used with a helper script to break up snapshots. It will not do any magic for you.\n\nParameters:\n symbol (asset_symbol, required): the ticker symbol for asset\n addresses (snapshot_map, required): A map of addresses-to-amounts to transfer the new shares to\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_asset_issue_to_addresses_method_metadata);
}
{
// register method wallet_account_balance
TiValue::api::MethodData wallet_account_balance_method_metadata{"wallet_account_balance", nullptr,
/* description */ "Lists the total asset balances for the specified account",
/* returns */ "account_balance_summary_type",
/* params: */ {
{"account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists the total asset balances for the specified account\n\nParameters:\n account_name (account_name, optional, defaults to \"\"): the account to get a balance for, or leave empty for all accounts\n\nReturns:\n account_balance_summary_type\n",
/* aliases */ {"balance", "getbalance"}, true};
store_method_metadata(wallet_account_balance_method_metadata);
}
{
// register method wallet_account_balance_ids
TiValue::api::MethodData wallet_account_balance_ids_method_metadata{"wallet_account_balance_ids", nullptr,
/* description */ "Lists the balance IDs for the specified account",
/* returns */ "account_balance_id_summary_type",
/* params: */ {
{"account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists the balance IDs for the specified account\n\nParameters:\n account_name (account_name, optional, defaults to \"\"): the account to get a balance IDs for, or leave empty for all accounts\n\nReturns:\n account_balance_id_summary_type\n",
/* aliases */ {}, false};
store_method_metadata(wallet_account_balance_ids_method_metadata);
}
{
// register method wallet_account_list_public_keys
TiValue::api::MethodData wallet_account_list_public_keys_method_metadata{"wallet_account_list_public_keys", nullptr,
/* description */ "Lists all public keys in this account",
/* returns */ "public_key_summary_array",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists all public keys in this account\n\nParameters:\n account_name (account_name, required): the account for which public keys should be listed\n\nReturns:\n public_key_summary_array\n",
/* aliases */ {"public_keys"}, true};
store_method_metadata(wallet_account_list_public_keys_method_metadata);
}
{
// register method wallet_delegate_withdraw_pay
TiValue::api::MethodData wallet_delegate_withdraw_pay_method_metadata{"wallet_delegate_withdraw_pay", nullptr,
/* description */ "Used to transfer some of the delegate's pay from their balance",
/* returns */ "transaction_entry",
/* params: */ {
{"delegate_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"amount_to_withdraw", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Used to transfer some of the delegate's pay from their balance\n\nParameters:\n delegate_name (account_name, required): the delegate whose pay is being cashed out\n to_account_name (account_name, required): the account that should receive the funds\n amount_to_withdraw (string, required): the amount to withdraw\n\nReturns:\n transaction_entry\n",
/* aliases */ {"pay_delegate"}, false};
store_method_metadata(wallet_delegate_withdraw_pay_method_metadata);
}
{
// register method wallet_delegate_pay_balance_query
TiValue::api::MethodData wallet_delegate_pay_balance_query_method_metadata{"wallet_delegate_pay_balance_query", nullptr,
/* description */ "query delegate's pay balance",
/* returns */ "delegate_salarys",
/* params: */ {
{"delegate_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "query delegate's pay balance\n\nParameters:\n delegate_name (account_name, required): the delegate whose pay is being cashed out\n\nReturns:\n delegate_salarys\n",
/* aliases */ {"query_salary"}, false};
store_method_metadata(wallet_delegate_pay_balance_query_method_metadata);
}
{
// register method wallet_active_delegate_salary
TiValue::api::MethodData wallet_active_delegate_salary_method_metadata{"wallet_active_delegate_salary", nullptr,
/* description */ "query delegate's pay balance",
/* returns */ "delegate_salary_map",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "query delegate's pay balance\n\nParameters:\n (none)\n\nReturns:\n delegate_salary_map\n",
/* aliases */ {}, false};
store_method_metadata(wallet_active_delegate_salary_method_metadata);
}
{
// register method wallet_get_delegate_statue
TiValue::api::MethodData wallet_get_delegate_statue_method_metadata{"wallet_get_delegate_statue", nullptr,
/* description */ "Get delegate produce block statue",
/* returns */ "bool",
/* params: */ {
{"account_name", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get delegate produce block statue\n\nParameters:\n account_name (string, required): delegate account name to get statue\n\nReturns:\n bool\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_delegate_statue_method_metadata);
}
{
// register method wallet_set_transaction_imessage_fee_coe
TiValue::api::MethodData wallet_set_transaction_imessage_fee_coe_method_metadata{"wallet_set_transaction_imessage_fee_coe", nullptr,
/* description */ "Set imessage fee coefficient",
/* returns */ "void",
/* params: */ {
{"fee_coe", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Set imessage fee coefficient\n\nParameters:\n fee_coe (string, required): fee coefficient\n\nReturns:\n void\n",
/* aliases */ {"set_fee_coe"}, false};
store_method_metadata(wallet_set_transaction_imessage_fee_coe_method_metadata);
}
{
// register method wallet_get_transaction_imessage_fee_coe
TiValue::api::MethodData wallet_get_transaction_imessage_fee_coe_method_metadata{"wallet_get_transaction_imessage_fee_coe", nullptr,
/* description */ "Get imessage fee coefficient",
/* returns */ "real_amount",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get imessage fee coefficient\n\nParameters:\n (none)\n\nReturns:\n real_amount\n",
/* aliases */ {"get_fee_coe"}, false};
store_method_metadata(wallet_get_transaction_imessage_fee_coe_method_metadata);
}
{
// register method wallet_set_transaction_imessage_soft_max_length
TiValue::api::MethodData wallet_set_transaction_imessage_soft_max_length_method_metadata{"wallet_set_transaction_imessage_soft_max_length", nullptr,
/* description */ "Set imessage soft max length",
/* returns */ "void",
/* params: */ {
{"soft_length", "amount", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Set imessage soft max length\n\nParameters:\n soft_length (amount, required): max soft length\n\nReturns:\n void\n",
/* aliases */ {"set_soft_length"}, false};
store_method_metadata(wallet_set_transaction_imessage_soft_max_length_method_metadata);
}
{
// register method wallet_get_transaction_imessage_soft_max_length
TiValue::api::MethodData wallet_get_transaction_imessage_soft_max_length_method_metadata{"wallet_get_transaction_imessage_soft_max_length", nullptr,
/* description */ "Get soft max length",
/* returns */ "amount",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get soft max length\n\nParameters:\n (none)\n\nReturns:\n amount\n",
/* aliases */ {"get_soft_length"}, false};
store_method_metadata(wallet_get_transaction_imessage_soft_max_length_method_metadata);
}
{
// register method wallet_set_transaction_fee
TiValue::api::MethodData wallet_set_transaction_fee_method_metadata{"wallet_set_transaction_fee", nullptr,
/* description */ "Set the fee to add to new transactions",
/* returns */ "asset",
/* params: */ {
{"fee", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Set the fee to add to new transactions\n\nParameters:\n fee (string, required): the wallet transaction fee to set\n\nReturns:\n asset\n",
/* aliases */ {"wallet_set_priority_fee", "set_priority_fee", "settrxfee", "setfee", "set_fee"}, false};
store_method_metadata(wallet_set_transaction_fee_method_metadata);
}
{
// register method wallet_get_transaction_fee
TiValue::api::MethodData wallet_get_transaction_fee_method_metadata{"wallet_get_transaction_fee", nullptr,
/* description */ "Returns ",
/* returns */ "asset",
/* params: */ {
{"symbol", "asset_symbol", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Returns \n\nParameters:\n symbol (asset_symbol, optional, defaults to \"\"): the wallet transaction if paid in the given asset type\n\nReturns:\n asset\n",
/* aliases */ {"wallet_get_priority_fee", "get_priority_fee", "gettrxfee", "getfee", "get_fee"}, true};
store_method_metadata(wallet_get_transaction_fee_method_metadata);
}
{
// register method wallet_dump_private_key
TiValue::api::MethodData wallet_dump_private_key_method_metadata{"wallet_dump_private_key", nullptr,
/* description */ "Reveals the private key corresponding to the specified public key or address; use with caution",
/* returns */ "optional_string",
/* params: */ {
{"input", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Reveals the private key corresponding to the specified public key or address; use with caution\n\nParameters:\n input (string, required): public key or address to dump private key for\n\nReturns:\n optional_string\n",
/* aliases */ {"dump_private_key", "dumpprivkey"}, false};
store_method_metadata(wallet_dump_private_key_method_metadata);
}
{
// register method wallet_dump_account_private_key
TiValue::api::MethodData wallet_dump_account_private_key_method_metadata{"wallet_dump_account_private_key", nullptr,
/* description */ "Reveals the specified account private key; use with caution",
/* returns */ "optional_string",
/* params: */ {
{"account_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"key_type", "account_key_type", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Reveals the specified account private key; use with caution\n\nParameters:\n account_name (string, required): account name to dump private key for\n key_type (account_key_type, required): which account private key to dump; one of {owner_key, active_key, signing_key}\n\nReturns:\n optional_string\n",
/* aliases */ {}, false};
store_method_metadata(wallet_dump_account_private_key_method_metadata);
}
{
// register method wallet_account_vote_summary
TiValue::api::MethodData wallet_account_vote_summary_method_metadata{"wallet_account_vote_summary", nullptr,
/* description */ "Returns the allocation of votes by this account",
/* returns */ "account_vote_summary",
/* params: */ {
{"account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Returns the allocation of votes by this account\n\nParameters:\n account_name (account_name, optional, defaults to \"\"): the account to report votes on, or empty for all accounts\n\nReturns:\n account_vote_summary\n",
/* aliases */ {"votes"}, false};
store_method_metadata(wallet_account_vote_summary_method_metadata);
}
{
// register method wallet_check_vote_status
TiValue::api::MethodData wallet_check_vote_status_method_metadata{"wallet_check_vote_status", nullptr,
/* description */ "Get info about the votes of balances controlled by this account",
/* returns */ "vote_summary",
/* params: */ {
{"account", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get info about the votes of balances controlled by this account\n\nParameters:\n account (account_name, required): \n\nReturns:\n vote_summary\n",
/* aliases */ {}, false};
store_method_metadata(wallet_check_vote_status_method_metadata);
}
{
// register method wallet_set_setting
TiValue::api::MethodData wallet_set_setting_method_metadata{"wallet_set_setting", nullptr,
/* description */ "Set a property in the GUI settings DB",
/* returns */ "void",
/* params: */ {
{"name", "string", TiValue::api::required_positional, fc::ovariant()},
{"value", "variant", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Set a property in the GUI settings DB\n\nParameters:\n name (string, required): the name of the setting to set\n value (variant, required): the value to set the setting to\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_set_setting_method_metadata);
}
{
// register method wallet_get_setting
TiValue::api::MethodData wallet_get_setting_method_metadata{"wallet_get_setting", nullptr,
/* description */ "Get the value of the given setting",
/* returns */ "optional_variant",
/* params: */ {
{"name", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Get the value of the given setting\n\nParameters:\n name (string, required): The name of the setting to fetch\n\nReturns:\n optional_variant\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_setting_method_metadata);
}
{
// register method wallet_delegate_set_block_production
TiValue::api::MethodData wallet_delegate_set_block_production_method_metadata{"wallet_delegate_set_block_production", nullptr,
/* description */ "Enable or disable block production for a particular delegate account",
/* returns */ "void",
/* params: */ {
{"delegate_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"enabled", "bool", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Enable or disable block production for a particular delegate account\n\nParameters:\n delegate_name (string, required): The delegate to enable/disable block production for; ALL for all delegate accounts\n enabled (bool, required): true to enable block production, false otherwise\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_delegate_set_block_production_method_metadata);
}
{
// register method wallet_set_transaction_scanning
TiValue::api::MethodData wallet_set_transaction_scanning_method_metadata{"wallet_set_transaction_scanning", nullptr,
/* description */ "Enable or disable wallet transaction scanning",
/* returns */ "bool",
/* params: */ {
{"enabled", "bool", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Enable or disable wallet transaction scanning\n\nParameters:\n enabled (bool, required): true to enable transaction scanning, false otherwise\n\nReturns:\n bool\n",
/* aliases */ {}, false};
store_method_metadata(wallet_set_transaction_scanning_method_metadata);
}
{
// register method wallet_sign_hash
TiValue::api::MethodData wallet_sign_hash_method_metadata{"wallet_sign_hash", nullptr,
/* description */ "Signs the provided message digest with the account key",
/* returns */ "compact_signature",
/* params: */ {
{"signer", "string", TiValue::api::required_positional, fc::ovariant()},
{"hash", "sha256", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Signs the provided message digest with the account key\n\nParameters:\n signer (string, required): A public key, address, or account name whose key to sign with\n hash (sha256, required): SHA256 digest of the message to sign\n\nReturns:\n compact_signature\n",
/* aliases */ {}, false};
store_method_metadata(wallet_sign_hash_method_metadata);
}
{
// register method wallet_login_start
TiValue::api::MethodData wallet_login_start_method_metadata{"wallet_login_start", nullptr,
/* description */ "Initiates the login procedure by providing a Alp Login URL",
/* returns */ "string",
/* params: */ {
{"server_account", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Initiates the login procedure by providing a Alp Login URL\n\nParameters:\n server_account (string, required): Name of the account of the server. The user will be shown this name as the site he is logging into.\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(wallet_login_start_method_metadata);
}
{
// register method wallet_login_finish
TiValue::api::MethodData wallet_login_finish_method_metadata{"wallet_login_finish", nullptr,
/* description */ "Completes the login procedure by finding the user's public account key and shared secret",
/* returns */ "variant",
/* params: */ {
{"server_key", "public_key", TiValue::api::required_positional, fc::ovariant()},
{"client_key", "public_key", TiValue::api::required_positional, fc::ovariant()},
{"client_signature", "compact_signature", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Completes the login procedure by finding the user's public account key and shared secret\n\nParameters:\n server_key (public_key, required): The one-time public key from wallet_login_start.\n client_key (public_key, required): The client's one-time public key.\n client_signature (compact_signature, required): The client's signature of the shared secret.\n\nReturns:\n variant\n",
/* aliases */ {}, false};
store_method_metadata(wallet_login_finish_method_metadata);
}
{
// register method wallet_balance_set_vote_info
TiValue::api::MethodData wallet_balance_set_vote_info_method_metadata{"wallet_balance_set_vote_info", nullptr,
/* description */ "Set this balance's voting address and slate",
/* returns */ "transaction_builder",
/* params: */ {
{"balance_id", "address", TiValue::api::required_positional, fc::ovariant()},
{"voter_address", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"strategy", "vote_strategy", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"vote_all\""))},
{"sign_and_broadcast", "bool", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"true\""))},
{"builder_path", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Set this balance's voting address and slate\n\nParameters:\n balance_id (address, required): the current name of the account\n voter_address (string, optional, defaults to \"\"): The new voting address. If none is specified, tries to re-use existing address.\n strategy (vote_strategy, optional, defaults to \"vote_all\"): enumeration [vote_none | vote_all | vote_random | vote_recommended] \n sign_and_broadcast (bool, optional, defaults to \"true\"): \n builder_path (string, optional, defaults to \"\"): If specified, will write builder here instead of to DATA_DIR/transactions/latest.trx\n\nReturns:\n transaction_builder\n",
/* aliases */ {"set_vote_info"}, false};
store_method_metadata(wallet_balance_set_vote_info_method_metadata);
}
{
// register method wallet_publish_slate
TiValue::api::MethodData wallet_publish_slate_method_metadata{"wallet_publish_slate", nullptr,
/* description */ "Publishes the current wallet delegate slate to the public data associated with the account",
/* returns */ "transaction_entry",
/* params: */ {
{"publishing_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"paying_account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Publishes the current wallet delegate slate to the public data associated with the account\n\nParameters:\n publishing_account_name (account_name, required): The account to publish the slate ID under\n paying_account_name (account_name, optional, defaults to \"\"): The account to pay transaction fees or leave empty to pay with publishing account\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_publish_slate_method_metadata);
}
{
// register method wallet_publish_version
TiValue::api::MethodData wallet_publish_version_method_metadata{"wallet_publish_version", nullptr,
/* description */ "Publish your current client version to the specified account's public data entry",
/* returns */ "transaction_entry",
/* params: */ {
{"publishing_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"paying_account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Publish your current client version to the specified account's public data entry\n\nParameters:\n publishing_account_name (account_name, required): The account to publish the client version under\n paying_account_name (account_name, optional, defaults to \"\"): The account to pay transaction fees with or leave empty to pay with publishing account\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_publish_version_method_metadata);
}
{
// register method wallet_collect_genesis_balances
TiValue::api::MethodData wallet_collect_genesis_balances_method_metadata{"wallet_collect_genesis_balances", nullptr,
/* description */ "Collect specified account's genesis balances",
/* returns */ "transaction_entry",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Collect specified account's genesis balances\n\nParameters:\n account_name (account_name, required): account to collect genesis balances for\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_collect_genesis_balances_method_metadata);
}
{
// register method wallet_recover_accounts
TiValue::api::MethodData wallet_recover_accounts_method_metadata{"wallet_recover_accounts", nullptr,
/* description */ "Attempts to recover accounts created after last backup was taken and returns number of successful recoveries. Use if you have restored from backup and are missing accounts.",
/* returns */ "int32_t",
/* params: */ {
{"accounts_to_recover", "int32_t", TiValue::api::required_positional, fc::ovariant()},
{"maximum_number_of_attempts", "int32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("1000"))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Attempts to recover accounts created after last backup was taken and returns number of successful recoveries. Use if you have restored from backup and are missing accounts.\n\nParameters:\n accounts_to_recover (int32_t, required): The number of accounts to attept to recover\n maximum_number_of_attempts (int32_t, optional, defaults to 1000): The maximum number of keys to generate trying to recover accounts\n\nReturns:\n int32_t\n",
/* aliases */ {}, false};
store_method_metadata(wallet_recover_accounts_method_metadata);
}
{
// register method wallet_verify_titan_deposit
TiValue::api::MethodData wallet_verify_titan_deposit_method_metadata{"wallet_verify_titan_deposit", nullptr,
/* description */ "Verify whether the specified transaction made a TITAN deposit to the current wallet; returns null if not",
/* returns */ "optional_variant_object",
/* params: */ {
{"transaction_id_prefix", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Verify whether the specified transaction made a TITAN deposit to the current wallet; returns null if not\n\nParameters:\n transaction_id_prefix (string, required): the id (or id prefix) of the transaction entry\n\nReturns:\n optional_variant_object\n",
/* aliases */ {}, false};
store_method_metadata(wallet_verify_titan_deposit_method_metadata);
}
{
// register method wallet_repair_entrys
TiValue::api::MethodData wallet_repair_entrys_method_metadata{"wallet_repair_entrys", nullptr,
/* description */ "tries to repair any inconsistent wallet account, key, and transaction entrys",
/* returns */ "void",
/* params: */ {
{"collecting_account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "tries to repair any inconsistent wallet account, key, and transaction entrys\n\nParameters:\n collecting_account_name (account_name, optional, defaults to \"\"): collect any orphan balances into this account\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_repair_entrys_method_metadata);
}
{
// register method wallet_regenerate_keys
TiValue::api::MethodData wallet_regenerate_keys_method_metadata{"wallet_regenerate_keys", nullptr,
/* description */ "regenerates private keys as part of wallet recovery",
/* returns */ "int32_t",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"max_key_number", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "regenerates private keys as part of wallet recovery\n\nParameters:\n account_name (account_name, required): the account the generated keys should be a part of\n max_key_number (uint32_t, required): the last key number to regenerate\n\nReturns:\n int32_t\n",
/* aliases */ {}, false};
store_method_metadata(wallet_regenerate_keys_method_metadata);
}
{
// register method wallet_account_retract
TiValue::api::MethodData wallet_account_retract_method_metadata{"wallet_account_retract", nullptr,
/* description */ "Retract (permanently disable) the specified account in case of master key compromise.",
/* returns */ "transaction_entry",
/* params: */ {
{"account_to_retract", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"pay_from_account", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Retract (permanently disable) the specified account in case of master key compromise.\n\nParameters:\n account_to_retract (account_name, required): The name of the account to retract.\n pay_from_account (account_name, required): The account from which fees will be paid.\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_account_retract_method_metadata);
}
{
// register method wallet_account_delete
TiValue::api::MethodData wallet_account_delete_method_metadata{"wallet_account_delete", nullptr,
/* description */ "delete account from Wallet.",
/* returns */ "bool",
/* params: */ {
{"account_name", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "delete account from Wallet.\n\nParameters:\n account_name (string, required): The name of the account to retract.\n\nReturns:\n bool\n",
/* aliases */ {}, false};
store_method_metadata(wallet_account_delete_method_metadata);
}
{
// register method wallet_transfer_to_address_rpc
TiValue::api::MethodData wallet_transfer_to_address_rpc_method_metadata{"wallet_transfer_to_address_rpc", nullptr,
/* description */ "Do a simple (non-TITAN) transfer to an address",
/* returns */ "string",
/* params: */ {
{"amount_to_transfer", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"memo_message", "information", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"strategy", "vote_strategy", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"vote_recommended\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Do a simple (non-TITAN) transfer to an address\n\nParameters:\n amount_to_transfer (string, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (account_name, required): the source account to draw the shares from\n to_address (string, required): the address or pubkey to transfer to\n memo_message (information, optional, defaults to \"\"): a memo to store with the transaction\n strategy (vote_strategy, optional, defaults to \"vote_recommended\"): enumeration [vote_none | vote_all | vote_random | vote_recommended] \n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(wallet_transfer_to_address_rpc_method_metadata);
}
{
// register method wallet_account_balance_rpc
TiValue::api::MethodData wallet_account_balance_rpc_method_metadata{"wallet_account_balance_rpc", nullptr,
/* description */ "Lists the total asset balances for the specified account",
/* returns */ "string",
/* params: */ {
{"account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 2,
/* detailed description */ "Lists the total asset balances for the specified account\n\nParameters:\n account_name (account_name, optional, defaults to \"\"): the account to get a balance for, or leave empty for all accounts\n\nReturns:\n string\n",
/* aliases */ {}, true};
store_method_metadata(wallet_account_balance_rpc_method_metadata);
}
{
// register method wallet_transfer_to_public_account_rpc
TiValue::api::MethodData wallet_transfer_to_public_account_rpc_method_metadata{"wallet_transfer_to_public_account_rpc", nullptr,
/* description */ "Sends given amount to the given account",
/* returns */ "string",
/* params: */ {
{"amount_to_transfer", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "sending_account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_account_name", "receive_account_name", TiValue::api::required_positional, fc::ovariant()},
{"memo_message", "information", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))},
{"strategy", "vote_strategy", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"vote_recommended\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Sends given amount to the given account\n\nParameters:\n amount_to_transfer (string, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (sending_account_name, required): the source account to draw the shares from\n to_account_name (receive_account_name, required): the account to transfer the shares to\n memo_message (information, optional, defaults to \"\"): a memo to store with the transaction\n strategy (vote_strategy, optional, defaults to \"vote_recommended\"): enumeration [vote_none | vote_all | vote_random | vote_recommended] \n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(wallet_transfer_to_public_account_rpc_method_metadata);
}
{
// register method wallet_get_account_owner_publickey
TiValue::api::MethodData wallet_get_account_owner_publickey_method_metadata{"wallet_get_account_owner_publickey", nullptr,
/* description */ "Get owner publickey of specific account",
/* returns */ "public_key",
/* params: */ {
{"account_name", "account_name", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Get owner publickey of specific account\n\nParameters:\n account_name (account_name, required): the name of the account\n\nReturns:\n public_key\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_account_owner_publickey_method_metadata);
}
{
// register method wallet_transfer_to_contract
TiValue::api::MethodData wallet_transfer_to_contract_method_metadata{"wallet_transfer_to_contract", nullptr,
/* description */ "Do a simple transfer to a contract (name or address)",
/* returns */ "transaction_entry",
/* params: */ {
{"amount_to_transfer", "real_amount", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"amount_for_exec", "real_amount", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Do a simple transfer to a contract (name or address)\n\nParameters:\n amount_to_transfer (real_amount, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (account_name, required): the source account to draw the shares from\n to_contract (string, required): the contract name or contract address to transfer to\n amount_for_exec (real_amount, required): the amount of shares to exec on_deposit callback of target contract\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(wallet_transfer_to_contract_method_metadata);
}
{
// register method wallet_transfer_to_contract_testing
TiValue::api::MethodData wallet_transfer_to_contract_testing_method_metadata{"wallet_transfer_to_contract_testing", nullptr,
/* description */ "Do a simple transfer to a contract (name or address) on local endpoint, and do not spread it on P2P network",
/* returns */ "asset_array",
/* params: */ {
{"amount_to_transfer", "real_amount", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_contract", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Do a simple transfer to a contract (name or address) on local endpoint, and do not spread it on P2P network\n\nParameters:\n amount_to_transfer (real_amount, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (account_name, required): the source account to draw the shares from\n to_contract (string, required): the contract name or contract address to transfer to\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(wallet_transfer_to_contract_testing_method_metadata);
}
{
// register method wallet_get_contracts
TiValue::api::MethodData wallet_get_contracts_method_metadata{"wallet_get_contracts", nullptr,
/* description */ "get all the contracts belong to the account of the wallet",
/* returns */ "contract_id_list",
/* params: */ {
{"account_name", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get all the contracts belong to the account of the wallet\n\nParameters:\n account_name (string, optional, defaults to \"\"): the account in wallet\n\nReturns:\n contract_id_list\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_contracts_method_metadata);
}
{
// register method wallet_scan_contracts
TiValue::api::MethodData wallet_scan_contracts_method_metadata{"wallet_scan_contracts", nullptr,
/* description */ "scan to get all the contracts",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "scan to get all the contracts\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_scan_contracts_method_metadata);
}
{
// register method about
TiValue::api::MethodData about_method_metadata{"about", nullptr,
/* description */ "Returns version number and associated information for this client",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns version number and associated information for this client\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {}, false};
store_method_metadata(about_method_metadata);
}
{
// register method get_info
TiValue::api::MethodData get_info_method_metadata{"get_info", nullptr,
/* description */ "Returns version number and associated information for this client",
/* returns */ "json_object",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns version number and associated information for this client\n\nParameters:\n (none)\n\nReturns:\n json_object\n",
/* aliases */ {"getinfo", "info"}, false};
store_method_metadata(get_info_method_metadata);
}
{
// register method stop
TiValue::api::MethodData stop_method_metadata{"stop", nullptr,
/* description */ "shut down the RPC server and exit this client",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "shut down the RPC server and exit this client\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {"quit", "exit"}, false};
store_method_metadata(stop_method_metadata);
}
{
// register method help
TiValue::api::MethodData help_method_metadata{"help", nullptr,
/* description */ "display a list of commands, or detailed help on an individual command",
/* returns */ "string",
/* params: */ {
{"command_name", "method_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "display a list of commands, or detailed help on an individual command\n\nParameters:\n command_name (method_name, optional, defaults to \"\"): the name of the method to get detailed help, or omit this for a list of commands\n\nReturns:\n string\n",
/* aliases */ {"h"}, false};
store_method_metadata(help_method_metadata);
}
{
// register method validate_address
TiValue::api::MethodData validate_address_method_metadata{"validate_address", nullptr,
/* description */ "Return information about given Alp address",
/* returns */ "json_object",
/* params: */ {
{"address", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Return information about given Alp address\n\nParameters:\n address (string, required): the address or public key to validate\n\nReturns:\n json_object\n",
/* aliases */ {"validateaddress"}, false};
store_method_metadata(validate_address_method_metadata);
}
{
// register method execute_command_line
TiValue::api::MethodData execute_command_line_method_metadata{"execute_command_line", nullptr,
/* description */ "Execute the given command as if it were typed on the CLI",
/* returns */ "string",
/* params: */ {
{"input", "passphrase", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Execute the given command as if it were typed on the CLI\n\nParameters:\n input (passphrase, required): The entire command input as if it were a CLI input\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(execute_command_line_method_metadata);
}
{
// register method execute_script
TiValue::api::MethodData execute_script_method_metadata{"execute_script", nullptr,
/* description */ "Execute the given file as if it were typed on the CLI",
/* returns */ "void",
/* params: */ {
{"script", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Execute the given file as if it were typed on the CLI\n\nParameters:\n script (filename, required): Name of a file containing CLI commands to execute\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(execute_script_method_metadata);
}
{
// register method batch
TiValue::api::MethodData batch_method_metadata{"batch", nullptr,
/* description */ "Takes any no_prerequisites command and an array of its arguments and returns an array of results. Example: batch blockchain_get_blockhash [[1], [2]]",
/* returns */ "variants",
/* params: */ {
{"method_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"parameters_list", "parameters_list", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Takes any no_prerequisites command and an array of its arguments and returns an array of results. Example: batch blockchain_get_blockhash [[1], [2]]\n\nParameters:\n method_name (string, required): The command name for calling\n parameters_list (parameters_list, required): The list of list of parameters for this command, the return will be the list of execute result of corresponding parameters\n\nReturns:\n variants\n",
/* aliases */ {}, false};
store_method_metadata(batch_method_metadata);
}
{
// register method batch_authenticated
TiValue::api::MethodData batch_authenticated_method_metadata{"batch_authenticated", nullptr,
/* description */ "Takes any no_prerequisites command and an array of its arguments and returns an array of results. Example: batch_authenticated blockchain_get_blockhash [[1], [2]]",
/* returns */ "variants",
/* params: */ {
{"method_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"parameters_list", "parameters_list", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Takes any no_prerequisites command and an array of its arguments and returns an array of results. Example: batch_authenticated blockchain_get_blockhash [[1], [2]]\n\nParameters:\n method_name (string, required): The command name for calling\n parameters_list (parameters_list, required): The list of list of parameters for this command, the return will be the list of execute result of corresponding parameters\n\nReturns:\n variants\n",
/* aliases */ {}, false};
store_method_metadata(batch_authenticated_method_metadata);
}
{
// register method builder_finalize_and_sign
TiValue::api::MethodData builder_finalize_and_sign_method_metadata{"builder_finalize_and_sign", nullptr,
/* description */ "Takes a transaction builder and returns a signed transaction for broadcasting",
/* returns */ "transaction_entry",
/* params: */ {
{"builder", "transaction_builder", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 5,
/* detailed description */ "Takes a transaction builder and returns a signed transaction for broadcasting\n\nParameters:\n builder (transaction_builder, required): \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(builder_finalize_and_sign_method_metadata);
}
{
// register method meta_help
TiValue::api::MethodData meta_help_method_metadata{"meta_help", nullptr,
/* description */ "Returns help information as JSON data",
/* returns */ "method_map_type",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "Returns help information as JSON data\n\nParameters:\n (none)\n\nReturns:\n method_map_type\n",
/* aliases */ {}, false};
store_method_metadata(meta_help_method_metadata);
}
{
// register method rpc_set_username
TiValue::api::MethodData rpc_set_username_method_metadata{"rpc_set_username", nullptr,
/* description */ "Set the username for basic auth for the http server.",
/* returns */ "void",
/* params: */ {
{"username", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Set the username for basic auth for the http server.\n\nParameters:\n username (string, optional, defaults to \"\"): Username for basic auth\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(rpc_set_username_method_metadata);
}
{
// register method rpc_set_password
TiValue::api::MethodData rpc_set_password_method_metadata{"rpc_set_password", nullptr,
/* description */ "Set the password for basic auth for the http server.",
/* returns */ "void",
/* params: */ {
{"password", "passphrase", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Set the password for basic auth for the http server.\n\nParameters:\n password (passphrase, optional, defaults to \"\"): Password for basic auth\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(rpc_set_password_method_metadata);
}
{
// register method rpc_start_server
TiValue::api::MethodData rpc_start_server_method_metadata{"rpc_start_server", nullptr,
/* description */ "Set the port and start rpc server.",
/* returns */ "void",
/* params: */ {
{"port", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"65065\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Set the port and start rpc server.\n\nParameters:\n port (uint32_t, optional, defaults to \"65065\"): Port for rpc server\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(rpc_start_server_method_metadata);
}
{
// register method http_start_server
TiValue::api::MethodData http_start_server_method_metadata{"http_start_server", nullptr,
/* description */ "Set the port and start http server.",
/* returns */ "void",
/* params: */ {
{"port", "uint32_t", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"65066\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Set the port and start http server.\n\nParameters:\n port (uint32_t, optional, defaults to \"65066\"): Port for http server\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(http_start_server_method_metadata);
}
{
// register method ntp_update_time
TiValue::api::MethodData ntp_update_time_method_metadata{"ntp_update_time", nullptr,
/* description */ "Update the NTP time right now.",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Update the NTP time right now.\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(ntp_update_time_method_metadata);
}
{
// register method disk_usage
TiValue::api::MethodData disk_usage_method_metadata{"disk_usage", nullptr,
/* description */ "Report disk space taken up by different groups of client files",
/* returns */ "variant",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 1,
/* detailed description */ "Report disk space taken up by different groups of client files\n\nParameters:\n (none)\n\nReturns:\n variant\n",
/* aliases */ {"size", "sizes", "usage", "diskusage"}, false};
store_method_metadata(disk_usage_method_metadata);
}
{
// register method compile_contract
TiValue::api::MethodData compile_contract_method_metadata{"compile_contract", nullptr,
/* description */ "compile contract source code to byte code, and store to binary file",
/* returns */ "filename",
/* params: */ {
{"filename", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "compile contract source code to byte code, and store to binary file\n\nParameters:\n filename (filename, required): contract source file name\n\nReturns:\n filename\n",
/* aliases */ {}, true};
store_method_metadata(compile_contract_method_metadata);
}
{
// register method register_contract
TiValue::api::MethodData register_contract_method_metadata{"register_contract", nullptr,
/* description */ "register a temporary contract",
/* returns */ "string",
/* params: */ {
{"owner", "string", TiValue::api::required_positional, fc::ovariant()},
{"codefile", "filename", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"init_limit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "register a temporary contract\n\nParameters:\n owner (string, required): contract register owner address\n codefile (filename, required): contract bytesfile name\n asset_symbol (string, required): asset symbol name\n init_limit (optional_double, required): the limit of asset amount used to init contract \n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(register_contract_method_metadata);
}
{
// register method register_contract_testing
TiValue::api::MethodData register_contract_testing_method_metadata{"register_contract_testing", nullptr,
/* description */ "register a temporary contract on local endpoint, and do not spread it on P2P network",
/* returns */ "asset_array",
/* params: */ {
{"owner", "string", TiValue::api::required_positional, fc::ovariant()},
{"codefile", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "register a temporary contract on local endpoint, and do not spread it on P2P network\n\nParameters:\n owner (string, required): contract register owner address\n codefile (filename, required): contract bytesfile name\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(register_contract_testing_method_metadata);
}
{
// register method upgrade_contract
TiValue::api::MethodData upgrade_contract_method_metadata{"upgrade_contract", nullptr,
/* description */ "upgrade temporary contract to permanent contract",
/* returns */ "transaction_entry",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"upgrader_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_desc", "information", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"exec_limit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "upgrade temporary contract to permanent contract\n\nParameters:\n contract_address (string, required): contract address need to upgrade\n upgrader_name (string, required): upgrader name\n new_contract_name (string, required): permanent contract name\n new_contract_desc (information, required): permanent contract description\n asset_symbol (string, required): symbol of asset used to destroy\n exec_limit (optional_double, required): the limit of asset amount used to destroy contract \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(upgrade_contract_method_metadata);
}
{
// register method upgrade_contract_testing
TiValue::api::MethodData upgrade_contract_testing_method_metadata{"upgrade_contract_testing", nullptr,
/* description */ "test upgrade temporary contract to permanent contract",
/* returns */ "asset_array",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"upgrader_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_desc", "information", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "test upgrade temporary contract to permanent contract\n\nParameters:\n contract_address (string, required): contract address need to upgrade\n upgrader_name (string, required): upgrader name\n new_contract_name (string, required): permanent contract name\n new_contract_desc (information, required): permanent contract description\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(upgrade_contract_testing_method_metadata);
}
{
// register method destroy_contract
TiValue::api::MethodData destroy_contract_method_metadata{"destroy_contract", nullptr,
/* description */ "destroy temporary contract",
/* returns */ "transaction_entry",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"destroyer_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"exec_limit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "destroy temporary contract\n\nParameters:\n contract_address (string, required): contract address need to destroy\n destroyer_name (string, required): destroyer name\n asset_symbol (string, required): symbol of asset used to destroy\n exec_limit (optional_double, required): the limit of asset amount used to destroy contract \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(destroy_contract_method_metadata);
}
{
// register method destroy_contract_testing
TiValue::api::MethodData destroy_contract_testing_method_metadata{"destroy_contract_testing", nullptr,
/* description */ "testing destroy temporary contract",
/* returns */ "asset_array",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"destroyer_name", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "testing destroy temporary contract\n\nParameters:\n contract_address (string, required): contract address need to destroy\n destroyer_name (string, required): destroyer name\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(destroy_contract_testing_method_metadata);
}
{
// register method call_contract
TiValue::api::MethodData call_contract_method_metadata{"call_contract", nullptr,
/* description */ "call contract by contract name or contract address",
/* returns */ "transaction_entry",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"caller_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"function_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"params", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"call_limit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "call contract by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address need to be called\n caller_name (string, required): caller name\n function_name (string, required): function in contract \n params (string, required): parameters which would be passed to function\n asset_symbol (string, required): symbol of asset used to call\n call_limit (optional_double, required): the limit of asset amount used to call contract \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(call_contract_method_metadata);
}
{
// register method get_contract_info
TiValue::api::MethodData get_contract_info_method_metadata{"get_contract_info", nullptr,
/* description */ "get contract entry by contract name or contract address",
/* returns */ "contract_entry_printable",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get contract entry by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address\n\nReturns:\n contract_entry_printable\n",
/* aliases */ {}, false};
store_method_metadata(get_contract_info_method_metadata);
}
{
// register method get_contract_balance
TiValue::api::MethodData get_contract_balance_method_metadata{"get_contract_balance", nullptr,
/* description */ "get contract balance entry and margin balance entry by contract name or contract address",
/* returns */ "balance_entry_list",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get contract balance entry and margin balance entry by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address\n\nReturns:\n balance_entry_list\n",
/* aliases */ {}, false};
store_method_metadata(get_contract_balance_method_metadata);
}
{
// register method call_contract_testing
TiValue::api::MethodData call_contract_testing_method_metadata{"call_contract_testing", nullptr,
/* description */ "call contract function by contract name or contract address on local endpoint, and do not spread it on P2P network",
/* returns */ "asset_array",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"caller_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"function_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"params", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "call contract function by contract name or contract address on local endpoint, and do not spread it on P2P network\n\nParameters:\n contract (string, required): contract name or contract address need to be called\n caller_name (string, required): caller name\n function_name (string, required): function in contract \n params (string, required): parameters which would be passed to function\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(call_contract_testing_method_metadata);
}
{
// register method call_contract_offline
TiValue::api::MethodData call_contract_offline_method_metadata{"call_contract_offline", nullptr,
/* description */ "call contract offline function by contract name or contract address",
/* returns */ "string",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"caller_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"function_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"params", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "call contract offline function by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address need to be called\n caller_name (string, required): caller name\n function_name (string, required): offline function in contract \n params (string, required): parameters which would be passed to offline function\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(call_contract_offline_method_metadata);
}
{
// register method load_contract_to_file
TiValue::api::MethodData load_contract_to_file_method_metadata{"load_contract_to_file", nullptr,
/* description */ "save contract to file",
/* returns */ "contract_entry_printable",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"file", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "save contract to file\n\nParameters:\n contract (string, required): contract name or contract address need to be saved\n file (filename, required): the file name with full path\n\nReturns:\n contract_entry_printable\n",
/* aliases */ {}, false};
store_method_metadata(load_contract_to_file_method_metadata);
}
{
// register method get_result_trx_id
TiValue::api::MethodData get_result_trx_id_method_metadata{"get_result_trx_id", nullptr,
/* description */ "get result tranraction id according to request trx id",
/* returns */ "transaction_id",
/* params: */ {
{"request_id", "transaction_id", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get result tranraction id according to request trx id\n\nParameters:\n request_id (transaction_id, required): transaction id of request\n\nReturns:\n transaction_id\n",
/* aliases */ {}, false};
store_method_metadata(get_result_trx_id_method_metadata);
}
{
// register method get_request_trx_id
TiValue::api::MethodData get_request_trx_id_method_metadata{"get_request_trx_id", nullptr,
/* description */ "get request tranraction id according to result trx id",
/* returns */ "transaction_id",
/* params: */ {
{"request_id", "transaction_id", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get request tranraction id according to result trx id\n\nParameters:\n request_id (transaction_id, required): transaction id of result\n\nReturns:\n transaction_id\n",
/* aliases */ {}, false};
store_method_metadata(get_request_trx_id_method_metadata);
}
{
// register method sandbox_open
TiValue::api::MethodData sandbox_open_method_metadata{"sandbox_open", nullptr,
/* description */ "open sandbox, let the state in sandbox related state",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "open sandbox, let the state in sandbox related state\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_open_method_metadata);
}
{
// register method sandbox_close
TiValue::api::MethodData sandbox_close_method_metadata{"sandbox_close", nullptr,
/* description */ "close sandbox, clear sandbox related state",
/* returns */ "void",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "close sandbox, clear sandbox related state\n\nParameters:\n (none)\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_close_method_metadata);
}
{
// register method sandbox_register_contract
TiValue::api::MethodData sandbox_register_contract_method_metadata{"sandbox_register_contract", nullptr,
/* description */ "in sandbox state: register a temporary contract",
/* returns */ "string",
/* params: */ {
{"owner", "string", TiValue::api::required_positional, fc::ovariant()},
{"codefile", "filename", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"initLimit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: register a temporary contract\n\nParameters:\n owner (string, required): contract register owner address\n codefile (filename, required): contract bytesfile name\n asset_symbol (string, required): asset symbol name\n initLimit (optional_double, required): the limit of asset amount used to init contract \n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_register_contract_method_metadata);
}
{
// register method sandbox_call_contract
TiValue::api::MethodData sandbox_call_contract_method_metadata{"sandbox_call_contract", nullptr,
/* description */ "in sandbox state: call contract by contract name or contract address",
/* returns */ "transaction_entry",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"caller_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"function_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"params", "string", TiValue::api::required_positional, fc::ovariant()},
{"cost_asset", "string", TiValue::api::required_positional, fc::ovariant()},
{"callLimit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: call contract by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address need to be called\n caller_name (string, required): destroyer name\n function_name (string, required): function in contract \n params (string, required): parameters which would be passed to function\n cost_asset (string, required): symbol of asset used to call\n callLimit (optional_double, required): the limit of asset amount used to call contract \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_call_contract_method_metadata);
}
{
// register method sandbox_upgrade_contract
TiValue::api::MethodData sandbox_upgrade_contract_method_metadata{"sandbox_upgrade_contract", nullptr,
/* description */ "in sandbox state: upgrade temporary contract to permanent contract",
/* returns */ "transaction_entry",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"upgrader_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_desc", "information", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"exec_limit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: upgrade temporary contract to permanent contract\n\nParameters:\n contract_address (string, required): contract address need to upgrade\n upgrader_name (string, required): upgrader name\n new_contract_name (string, required): permanent contract name\n new_contract_desc (information, required): permanent contract description\n asset_symbol (string, required): symbol of asset used to destroy\n exec_limit (optional_double, required): the limit of asset amount used to destroy contract \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_upgrade_contract_method_metadata);
}
{
// register method sandbox_upgrade_contract_testing
TiValue::api::MethodData sandbox_upgrade_contract_testing_method_metadata{"sandbox_upgrade_contract_testing", nullptr,
/* description */ "in sandbox state: upgrade temporary contract to permanent contract",
/* returns */ "asset_array",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"upgrader_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"new_contract_desc", "information", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: upgrade temporary contract to permanent contract\n\nParameters:\n contract_address (string, required): contract address need to upgrade\n upgrader_name (string, required): upgrader name\n new_contract_name (string, required): permanent contract name\n new_contract_desc (information, required): permanent contract description\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_upgrade_contract_testing_method_metadata);
}
{
// register method sandbox_destroy_contract
TiValue::api::MethodData sandbox_destroy_contract_method_metadata{"sandbox_destroy_contract", nullptr,
/* description */ "in sandbox state: destroy temporary contract",
/* returns */ "transaction_entry",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"destroyer_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"exec_limit", "optional_double", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: destroy temporary contract\n\nParameters:\n contract_address (string, required): contract address need to destroy\n destroyer_name (string, required): destroyer name\n asset_symbol (string, required): symbol of asset used to destroy\n exec_limit (optional_double, required): the limit of asset amount used to destroy contract \n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_destroy_contract_method_metadata);
}
{
// register method sandbox_destroy_contract_testing
TiValue::api::MethodData sandbox_destroy_contract_testing_method_metadata{"sandbox_destroy_contract_testing", nullptr,
/* description */ "in sandbox state: test destroy temporary contract",
/* returns */ "asset_array",
/* params: */ {
{"contract_address", "string", TiValue::api::required_positional, fc::ovariant()},
{"destroyer_name", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: test destroy temporary contract\n\nParameters:\n contract_address (string, required): contract address need to destroy\n destroyer_name (string, required): destroyer name\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_destroy_contract_testing_method_metadata);
}
{
// register method sandbox_get_contract_info
TiValue::api::MethodData sandbox_get_contract_info_method_metadata{"sandbox_get_contract_info", nullptr,
/* description */ "in sandbox state: get contract entry by contract name or contract address",
/* returns */ "contract_entry_printable",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: get contract entry by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address\n\nReturns:\n contract_entry_printable\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_get_contract_info_method_metadata);
}
{
// register method sandbox_get_contract_balance
TiValue::api::MethodData sandbox_get_contract_balance_method_metadata{"sandbox_get_contract_balance", nullptr,
/* description */ "in sandbox state: get contract balance entry and margin balance entry by contract name or contract address",
/* returns */ "balance_entry_list",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: get contract balance entry and margin balance entry by contract name or contract address\n\nParameters:\n contract (string, required): contract name or contract address\n\nReturns:\n balance_entry_list\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_get_contract_balance_method_metadata);
}
{
// register method sandbox_transfer_to_contract
TiValue::api::MethodData sandbox_transfer_to_contract_method_metadata{"sandbox_transfer_to_contract", nullptr,
/* description */ "in sandbox state: transfer to contract",
/* returns */ "transaction_entry",
/* params: */ {
{"amount_to_transfer", "real_amount", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"amount_for_exec", "real_amount", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: transfer to contract\n\nParameters:\n amount_to_transfer (real_amount, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (account_name, required): the source account to draw the shares from\n to_contract (string, required): the contract name or contract address to transfer to\n amount_for_exec (real_amount, required): the amount of shares to exec\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_transfer_to_contract_method_metadata);
}
{
// register method sandbox_account_balance
TiValue::api::MethodData sandbox_account_balance_method_metadata{"sandbox_account_balance", nullptr,
/* description */ "in sandbox state: lookup balance of account",
/* returns */ "account_balance_summary_type",
/* params: */ {
{"account_name", "account_name", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox state: lookup balance of account\n\nParameters:\n account_name (account_name, optional, defaults to \"\"): the account to lookup balance\n\nReturns:\n account_balance_summary_type\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_account_balance_method_metadata);
}
{
// register method sandbox_compile_contract
TiValue::api::MethodData sandbox_compile_contract_method_metadata{"sandbox_compile_contract", nullptr,
/* description */ "in sandbox compile contract source code to byte code, and store to binary file",
/* returns */ "filename",
/* params: */ {
{"filename", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox compile contract source code to byte code, and store to binary file\n\nParameters:\n filename (filename, required): contract source file name\n\nReturns:\n filename\n",
/* aliases */ {}, true};
store_method_metadata(sandbox_compile_contract_method_metadata);
}
{
// register method sandbox_load_contract_to_file
TiValue::api::MethodData sandbox_load_contract_to_file_method_metadata{"sandbox_load_contract_to_file", nullptr,
/* description */ "in sandbox save contract to a gpc file",
/* returns */ "contract_entry_printable",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"file", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox save contract to a gpc file\n\nParameters:\n contract (string, required): contract name or contract address need to be saved\n file (filename, required): the file name with full path\n\nReturns:\n contract_entry_printable\n",
/* aliases */ {}, true};
store_method_metadata(sandbox_load_contract_to_file_method_metadata);
}
{
// register method sandbox_register_contract_testing
TiValue::api::MethodData sandbox_register_contract_testing_method_metadata{"sandbox_register_contract_testing", nullptr,
/* description */ "in sandbox register a temporary contract on local endpoint, and do not spread it on P2P network",
/* returns */ "asset_array",
/* params: */ {
{"owner", "string", TiValue::api::required_positional, fc::ovariant()},
{"codefile", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox register a temporary contract on local endpoint, and do not spread it on P2P network\n\nParameters:\n owner (string, required): contract register owner address\n codefile (filename, required): contract bytesfile name\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_register_contract_testing_method_metadata);
}
{
// register method sandbox_call_contract_testing
TiValue::api::MethodData sandbox_call_contract_testing_method_metadata{"sandbox_call_contract_testing", nullptr,
/* description */ "in sandbox call contract function by contract name or contract address on local endpoint, and do not spread it on P2P network",
/* returns */ "asset_array",
/* params: */ {
{"contract", "string", TiValue::api::required_positional, fc::ovariant()},
{"caller_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"function_name", "string", TiValue::api::required_positional, fc::ovariant()},
{"params", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox call contract function by contract name or contract address on local endpoint, and do not spread it on P2P network\n\nParameters:\n contract (string, required): contract name or contract address need to be called\n caller_name (string, required): caller name\n function_name (string, required): function in contract \n params (string, required): parameters which would be passed to function\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_call_contract_testing_method_metadata);
}
{
// register method sandbox_transfer_to_contract_testing
TiValue::api::MethodData sandbox_transfer_to_contract_testing_method_metadata{"sandbox_transfer_to_contract_testing", nullptr,
/* description */ "in sandbox Do a simple transfer to a contract (name or address) on local endpoint, and do not spread it on P2P network",
/* returns */ "asset_array",
/* params: */ {
{"amount_to_transfer", "real_amount", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "asset_symbol", TiValue::api::required_positional, fc::ovariant()},
{"from_account_name", "account_name", TiValue::api::required_positional, fc::ovariant()},
{"to_contract", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "in sandbox Do a simple transfer to a contract (name or address) on local endpoint, and do not spread it on P2P network\n\nParameters:\n amount_to_transfer (real_amount, required): the amount of shares to transfer\n asset_symbol (asset_symbol, required): the asset to transfer\n from_account_name (account_name, required): the source account to draw the shares from\n to_contract (string, required): the contract name or contract address to transfer to\n\nReturns:\n asset_array\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_transfer_to_contract_testing_method_metadata);
}
{
// register method sandbox_list_my_addresses
TiValue::api::MethodData sandbox_list_my_addresses_method_metadata{"sandbox_list_my_addresses", nullptr,
/* description */ "list the account info of the wallet",
/* returns */ "sandbox_account_info_list",
/* params: */ {
{"account_name", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 16,
/* detailed description */ "list the account info of the wallet\n\nParameters:\n account_name (string, optional, defaults to \"\"): the account in wallet\n\nReturns:\n sandbox_account_info_list\n",
/* aliases */ {}, false};
store_method_metadata(sandbox_list_my_addresses_method_metadata);
}
{
// register method get_contract_registered_in_transaction
TiValue::api::MethodData get_contract_registered_in_transaction_method_metadata{"get_contract_registered_in_transaction", nullptr,
/* description */ "get id of contract registered in specific transaction",
/* returns */ "string",
/* params: */ {
{"trx_id", "transaction_id", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get id of contract registered in specific transaction\n\nParameters:\n trx_id (transaction_id, required): specific contract id\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(get_contract_registered_in_transaction_method_metadata);
}
{
// register method get_transaction_id_contract_registered
TiValue::api::MethodData get_transaction_id_contract_registered_method_metadata{"get_transaction_id_contract_registered", nullptr,
/* description */ "get id of transaction that specific contract registered in ",
/* returns */ "transaction_id",
/* params: */ {
{"contract_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get id of transaction that specific contract registered in \n\nParameters:\n contract_id (string, required): specific contract id\n\nReturns:\n transaction_id\n",
/* aliases */ {}, false};
store_method_metadata(get_transaction_id_contract_registered_method_metadata);
}
{
// register method get_contract_info_from_gpc_file
TiValue::api::MethodData get_contract_info_from_gpc_file_method_metadata{"get_contract_info_from_gpc_file", nullptr,
/* description */ "get contract info from gpc file",
/* returns */ "code_printable",
/* params: */ {
{"file", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "get contract info from gpc file\n\nParameters:\n file (filename, required): contract gpc file name\n\nReturns:\n code_printable\n",
/* aliases */ {}, true};
store_method_metadata(get_contract_info_from_gpc_file_method_metadata);
}
{
// register method compile_script
TiValue::api::MethodData compile_script_method_metadata{"compile_script", nullptr,
/* description */ "compile script source code to byte code, and store to binary file",
/* returns */ "filename",
/* params: */ {
{"filename", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 0,
/* detailed description */ "compile script source code to byte code, and store to binary file\n\nParameters:\n filename (filename, required): script source file name\n\nReturns:\n filename\n",
/* aliases */ {}, true};
store_method_metadata(compile_script_method_metadata);
}
{
// register method add_script
TiValue::api::MethodData add_script_method_metadata{"add_script", nullptr,
/* description */ "Add a compiled script to database",
/* returns */ "string",
/* params: */ {
{"filename", "filename", TiValue::api::required_positional, fc::ovariant()},
{"description", "information", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Add a compiled script to database\n\nParameters:\n filename (filename, required): filename of the specified script\n description (information, required): description of the script\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(add_script_method_metadata);
}
{
// register method remove_script
TiValue::api::MethodData remove_script_method_metadata{"remove_script", nullptr,
/* description */ "Remove a compiled script form database",
/* returns */ "void",
/* params: */ {
{"scriptid", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Remove a compiled script form database\n\nParameters:\n scriptid (string, required): scriptid of the specified script\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(remove_script_method_metadata);
}
{
// register method get_script_info
TiValue::api::MethodData get_script_info_method_metadata{"get_script_info", nullptr,
/* description */ "Get info of a script specified by script_id ",
/* returns */ "scriptentry_printable",
/* params: */ {
{"scriptid", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Get info of a script specified by script_id \n\nParameters:\n scriptid (string, required): scriptid of the specified script\n\nReturns:\n scriptentry_printable\n",
/* aliases */ {}, false};
store_method_metadata(get_script_info_method_metadata);
}
{
// register method list_scripts
TiValue::api::MethodData list_scripts_method_metadata{"list_scripts", nullptr,
/* description */ "List all scripts in database ",
/* returns */ "scriptentry_printable_list",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "List all scripts in database \n\nParameters:\n (none)\n\nReturns:\n scriptentry_printable_list\n",
/* aliases */ {}, false};
store_method_metadata(list_scripts_method_metadata);
}
{
// register method disable_script
TiValue::api::MethodData disable_script_method_metadata{"disable_script", nullptr,
/* description */ "disable a compiled script from database",
/* returns */ "void",
/* params: */ {
{"scriptid", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "disable a compiled script from database\n\nParameters:\n scriptid (string, required): scriptid of the specified script\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(disable_script_method_metadata);
}
{
// register method enable_script
TiValue::api::MethodData enable_script_method_metadata{"enable_script", nullptr,
/* description */ "enable a compiled script from database",
/* returns */ "void",
/* params: */ {
{"scriptid", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "enable a compiled script from database\n\nParameters:\n scriptid (string, required): scriptid of the specified script\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(enable_script_method_metadata);
}
{
// register method import_script_db
TiValue::api::MethodData import_script_db_method_metadata{"import_script_db", nullptr,
/* description */ "import scripts from a database directory",
/* returns */ "void",
/* params: */ {
{"dbfile", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "import scripts from a database directory\n\nParameters:\n dbfile (filename, required): path of database for importing from\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(import_script_db_method_metadata);
}
{
// register method export_script_db
TiValue::api::MethodData export_script_db_method_metadata{"export_script_db", nullptr,
/* description */ "export scripts to a database directory",
/* returns */ "void",
/* params: */ {
{"dbfile", "filename", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "export scripts to a database directory\n\nParameters:\n dbfile (filename, required): path of database for exporting to\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(export_script_db_method_metadata);
}
{
// register method get_events_bound
TiValue::api::MethodData get_events_bound_method_metadata{"get_events_bound", nullptr,
/* description */ "get contract id and event which binded with specific script",
/* returns */ "string_array",
/* params: */ {
{"script_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get contract id and event which binded with specific script\n\nParameters:\n script_id (string, required): id of specific script\n\nReturns:\n string_array\n",
/* aliases */ {}, false};
store_method_metadata(get_events_bound_method_metadata);
}
{
// register method list_event_handler
TiValue::api::MethodData list_event_handler_method_metadata{"list_event_handler", nullptr,
/* description */ "list all event handlers related with the specified contract id and event type",
/* returns */ "scriptid_list",
/* params: */ {
{"contract_id_str", "string", TiValue::api::required_positional, fc::ovariant()},
{"event_type", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list all event handlers related with the specified contract id and event type\n\nParameters:\n contract_id_str (string, required): id of the binding contract at blockchain\n event_type (string, required): type of the binding event at blockchain\n\nReturns:\n scriptid_list\n",
/* aliases */ {}, false};
store_method_metadata(list_event_handler_method_metadata);
}
{
// register method add_event_handler
TiValue::api::MethodData add_event_handler_method_metadata{"add_event_handler", nullptr,
/* description */ "set a new relation with a script to the specified contract id and event type",
/* returns */ "void",
/* params: */ {
{"contract_id_str", "string", TiValue::api::required_positional, fc::ovariant()},
{"event_type", "string", TiValue::api::required_positional, fc::ovariant()},
{"script_id", "string", TiValue::api::required_positional, fc::ovariant()},
{"index", "uint32_t", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "set a new relation with a script to the specified contract id and event type\n\nParameters:\n contract_id_str (string, required): id of contract at blockchain want to bind\n event_type (string, required): type of event at blockchain want to bind\n script_id (string, required): id of local script want to bind with\n index (uint32_t, required): the position of script vector want to insert\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(add_event_handler_method_metadata);
}
{
// register method delete_event_handler
TiValue::api::MethodData delete_event_handler_method_metadata{"delete_event_handler", nullptr,
/* description */ "drop the relation with a script to the specified contract id and event type",
/* returns */ "void",
/* params: */ {
{"contract_id_str", "string", TiValue::api::required_positional, fc::ovariant()},
{"event_type", "string", TiValue::api::required_positional, fc::ovariant()},
{"script_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "drop the relation with a script to the specified contract id and event type\n\nParameters:\n contract_id_str (string, required): id of contract at blockchain want to delete\n event_type (string, required): type of event at blockchain want to delete\n script_id (string, required): id of local script want to delete with\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(delete_event_handler_method_metadata);
}
{
// register method store_file_to_network
TiValue::api::MethodData store_file_to_network_method_metadata{"store_file_to_network", nullptr,
/* description */ "Call FileUpload Contract to ask for file storage",
/* returns */ "UploadRequestEntry",
/* params: */ {
{"owner", "string", TiValue::api::required_positional, fc::ovariant()},
{"AuthorizatingContractId", "string", TiValue::api::required_positional, fc::ovariant()},
{"file", "path", TiValue::api::required_positional, fc::ovariant()},
{"asset_symbol", "string", TiValue::api::required_positional, fc::ovariant()},
{"price", "real_amount", TiValue::api::required_positional, fc::ovariant()},
{"numofcopy", "uint32_t", TiValue::api::required_positional, fc::ovariant()},
{"numofpiece", "uint32_t", TiValue::api::required_positional, fc::ovariant()},
{"payterm", "uint32_t", TiValue::api::required_positional, fc::ovariant()},
{"exec_limit", "real_amount", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "Call FileUpload Contract to ask for file storage\n\nParameters:\n owner (string, required): File owner address\n AuthorizatingContractId (string, required): contract checking and authorizating to caller\n file (path, required): file to be uploaded\n asset_symbol (string, required): asset symbol name\n price (real_amount, required): the limit of asset amount used to init contract \n numofcopy (uint32_t, required): Nums of Copys \n numofpiece (uint32_t, required): Nums of pieces \n payterm (uint32_t, required): Nums of pieces \n exec_limit (real_amount, required): the limit of asset amount used to call FileUploadContract\n\nReturns:\n UploadRequestEntry\n",
/* aliases */ {}, false};
store_method_metadata(store_file_to_network_method_metadata);
}
{
// register method get_file_access
TiValue::api::MethodData get_file_access_method_metadata{"get_file_access", nullptr,
/* description */ "get a permission to access a specific file",
/* returns */ "transaction_entry",
/* params: */ {
{"file_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get a permission to access a specific file\n\nParameters:\n file_id (string, required): id of file\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(get_file_access_method_metadata);
}
{
// register method store_file_piece
TiValue::api::MethodData store_file_piece_method_metadata{"store_file_piece", nullptr,
/* description */ "get permission to save specific file piece",
/* returns */ "transaction_entry",
/* params: */ {
{"file_id", "string", TiValue::api::required_positional, fc::ovariant()},
{"file_piece_id", "string", TiValue::api::required_positional, fc::ovariant()},
{"beneficiary", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get permission to save specific file piece\n\nParameters:\n file_id (string, required): id of file\n file_piece_id (string, required): id of file piece\n beneficiary (string, required): beneficiary of storing file\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(store_file_piece_method_metadata);
}
{
// register method store_reject
TiValue::api::MethodData store_reject_method_metadata{"store_reject", nullptr,
/* description */ "get permission to save specific file piece",
/* returns */ "transaction_entry",
/* params: */ {
{"file_id", "string", TiValue::api::required_positional, fc::ovariant()},
{"file_piece_id", "string", TiValue::api::required_positional, fc::ovariant()},
{"node_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get permission to save specific file piece\n\nParameters:\n file_id (string, required): id of file\n file_piece_id (string, required): id of file piece\n node_id (string, required): node id\n\nReturns:\n transaction_entry\n",
/* aliases */ {}, false};
store_method_metadata(store_reject_method_metadata);
}
{
// register method wallet_set_node_id
TiValue::api::MethodData wallet_set_node_id_method_metadata{"wallet_set_node_id", nullptr,
/* description */ "set local node id",
/* returns */ "void",
/* params: */ {
{"node_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "set local node id\n\nParameters:\n node_id (string, required): id of this node\n\nReturns:\n void\n",
/* aliases */ {}, false};
store_method_metadata(wallet_set_node_id_method_metadata);
}
{
// register method blockchain_list_file_saved
TiValue::api::MethodData blockchain_list_file_saved_method_metadata{"blockchain_list_file_saved", nullptr,
/* description */ "set local node id",
/* returns */ "file_id_list",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "set local node id\n\nParameters:\n (none)\n\nReturns:\n file_id_list\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_list_file_saved_method_metadata);
}
{
// register method blockchain_get_file_authorizing_contract
TiValue::api::MethodData blockchain_get_file_authorizing_contract_method_metadata{"blockchain_get_file_authorizing_contract", nullptr,
/* description */ "get authorizing contract of specific file",
/* returns */ "string",
/* params: */ {
{"file_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get authorizing contract of specific file\n\nParameters:\n file_id (string, required): id of specific files\n\nReturns:\n string\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_get_file_authorizing_contract_method_metadata);
}
{
// register method wallet_list_store_request_for_my_file
TiValue::api::MethodData wallet_list_store_request_for_my_file_method_metadata{"wallet_list_store_request_for_my_file", nullptr,
/* description */ "get authorizing contract of specific file",
/* returns */ "StoreRequestInfoList",
/* params: */ {
{"file_id", "string", TiValue::api::optional_positional, fc::variant(fc::json::from_string("\"\""))}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get authorizing contract of specific file\n\nParameters:\n file_id (string, optional, defaults to \"\"): id of specific files\n\nReturns:\n StoreRequestInfoList\n",
/* aliases */ {}, false};
store_method_metadata(wallet_list_store_request_for_my_file_method_metadata);
}
{
// register method blockchain_check_signature
TiValue::api::MethodData blockchain_check_signature_method_metadata{"blockchain_check_signature", nullptr,
/* description */ "get authorizing contract of specific file",
/* returns */ "bool",
/* params: */ {
{"origin_data", "string", TiValue::api::required_positional, fc::ovariant()},
{"signature", "string", TiValue::api::required_positional, fc::ovariant()},
{"key", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "get authorizing contract of specific file\n\nParameters:\n origin_data (string, required): original data\n signature (string, required): signature data\n key (string, required): public key\n\nReturns:\n bool\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_check_signature_method_metadata);
}
{
// register method wallet_get_my_access
TiValue::api::MethodData wallet_get_my_access_method_metadata{"wallet_get_my_access", nullptr,
/* description */ "list id of files which can be accessed",
/* returns */ "FileAccessInfoList",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list id of files which can be accessed\n\nParameters:\n (none)\n\nReturns:\n FileAccessInfoList\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_my_access_method_metadata);
}
{
// register method wallet_get_my_upload_requests
TiValue::api::MethodData wallet_get_my_upload_requests_method_metadata{"wallet_get_my_upload_requests", nullptr,
/* description */ "list upload requests related to local accounts",
/* returns */ "UploadRequestEntryList",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list upload requests related to local accounts\n\nParameters:\n (none)\n\nReturns:\n UploadRequestEntryList\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_my_upload_requests_method_metadata);
}
{
// register method wallet_get_my_store_request
TiValue::api::MethodData wallet_get_my_store_request_method_metadata{"wallet_get_my_store_request", nullptr,
/* description */ "list store requests related to local accounts",
/* returns */ "piece_id_list",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list store requests related to local accounts\n\nParameters:\n (none)\n\nReturns:\n piece_id_list\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_my_store_request_method_metadata);
}
{
// register method wallet_get_my_store_confirmed
TiValue::api::MethodData wallet_get_my_store_confirmed_method_metadata{"wallet_get_my_store_confirmed", nullptr,
/* description */ "list pieces which uploader has confirmed that we saved",
/* returns */ "piece_id_list",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list pieces which uploader has confirmed that we saved\n\nParameters:\n (none)\n\nReturns:\n piece_id_list\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_my_store_confirmed_method_metadata);
}
{
// register method wallet_get_my_store_rejected
TiValue::api::MethodData wallet_get_my_store_rejected_method_metadata{"wallet_get_my_store_rejected", nullptr,
/* description */ "list pieces we saved which uploader has rejected ",
/* returns */ "FilePieceInfoList",
/* params: */ {},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list pieces we saved which uploader has rejected \n\nParameters:\n (none)\n\nReturns:\n FilePieceInfoList\n",
/* aliases */ {}, false};
store_method_metadata(wallet_get_my_store_rejected_method_metadata);
}
{
// register method blockchain_get_file_save_node
TiValue::api::MethodData blockchain_get_file_save_node_method_metadata{"blockchain_get_file_save_node", nullptr,
/* description */ "list all files",
/* returns */ "FileSaveInfo",
/* params: */ {
{"file_id", "string", TiValue::api::required_positional, fc::ovariant()}
},
/* prerequisites */ (TiValue::api::MethodPrerequisites) 4,
/* detailed description */ "list all files\n\nParameters:\n file_id (string, required): id of specific file\n\nReturns:\n FileSaveInfo\n",
/* aliases */ {}, false};
store_method_metadata(blockchain_get_file_save_node_method_metadata);
}
}
fc::variant CommonApiRpcServer::direct_invoke_positional_method(const std::string& method_name, const fc::variants& parameters)
{
if (method_name == "blockchain_get_info")
return blockchain_get_info_positional(nullptr, parameters);
if (method_name == "blockchain_generate_snapshot")
return blockchain_generate_snapshot_positional(nullptr, parameters);
if (method_name == "blockchain_get_alp_account_balance_entry")
return blockchain_get_alp_account_balance_entry_positional(nullptr, parameters);
if (method_name == "blockchain_generate_issuance_map")
return blockchain_generate_issuance_map_positional(nullptr, parameters);
if (method_name == "blockchain_calculate_supply")
return blockchain_calculate_supply_positional(nullptr, parameters);
if (method_name == "blockchain_is_synced")
return blockchain_is_synced_positional(nullptr, parameters);
if (method_name == "blockchain_get_block_count")
return blockchain_get_block_count_positional(nullptr, parameters);
if (method_name == "blockchain_get_security_state")
return blockchain_get_security_state_positional(nullptr, parameters);
if (method_name == "blockchain_list_accounts")
return blockchain_list_accounts_positional(nullptr, parameters);
if (method_name == "blockchain_list_recently_updated_accounts")
return blockchain_list_recently_updated_accounts_positional(nullptr, parameters);
if (method_name == "blockchain_list_recently_registered_accounts")
return blockchain_list_recently_registered_accounts_positional(nullptr, parameters);
if (method_name == "blockchain_list_assets")
return blockchain_list_assets_positional(nullptr, parameters);
if (method_name == "blockchain_list_pending_transactions")
return blockchain_list_pending_transactions_positional(nullptr, parameters);
if (method_name == "blockchain_get_transaction")
return blockchain_get_transaction_positional(nullptr, parameters);
if (method_name == "blockchain_get_pretty_transaction")
return blockchain_get_pretty_transaction_positional(nullptr, parameters);
if (method_name == "blockchain_get_pretty_contract_transaction")
return blockchain_get_pretty_contract_transaction_positional(nullptr, parameters);
if (method_name == "blockchain_get_block")
return blockchain_get_block_positional(nullptr, parameters);
if (method_name == "blockchain_get_block_transactions")
return blockchain_get_block_transactions_positional(nullptr, parameters);
if (method_name == "blockchain_get_account")
return blockchain_get_account_positional(nullptr, parameters);
if (method_name == "blockchain_get_slate")
return blockchain_get_slate_positional(nullptr, parameters);
if (method_name == "blockchain_get_balance")
return blockchain_get_balance_positional(nullptr, parameters);
if (method_name == "blockchain_list_balances")
return blockchain_list_balances_positional(nullptr, parameters);
if (method_name == "blockchain_list_address_balances")
return blockchain_list_address_balances_positional(nullptr, parameters);
if (method_name == "blockchain_list_address_transactions")
return blockchain_list_address_transactions_positional(nullptr, parameters);
if (method_name == "blockchain_get_account_public_balance")
return blockchain_get_account_public_balance_positional(nullptr, parameters);
if (method_name == "blockchain_list_key_balances")
return blockchain_list_key_balances_positional(nullptr, parameters);
if (method_name == "blockchain_get_asset")
return blockchain_get_asset_positional(nullptr, parameters);
if (method_name == "blockchain_list_active_delegates")
return blockchain_list_active_delegates_positional(nullptr, parameters);
if (method_name == "blockchain_list_delegates")
return blockchain_list_delegates_positional(nullptr, parameters);
if (method_name == "blockchain_list_blocks")
return blockchain_list_blocks_positional(nullptr, parameters);
if (method_name == "blockchain_list_missing_block_delegates")
return blockchain_list_missing_block_delegates_positional(nullptr, parameters);
if (method_name == "blockchain_export_fork_graph")
return blockchain_export_fork_graph_positional(nullptr, parameters);
if (method_name == "blockchain_list_forks")
return blockchain_list_forks_positional(nullptr, parameters);
if (method_name == "blockchain_get_delegate_slot_entrys")
return blockchain_get_delegate_slot_entrys_positional(nullptr, parameters);
if (method_name == "blockchain_get_block_signee")
return blockchain_get_block_signee_positional(nullptr, parameters);
if (method_name == "blockchain_unclaimed_genesis")
return blockchain_unclaimed_genesis_positional(nullptr, parameters);
if (method_name == "blockchain_verify_signature")
return blockchain_verify_signature_positional(nullptr, parameters);
if (method_name == "blockchain_dump_state")
return blockchain_dump_state_positional(nullptr, parameters);
if (method_name == "blockchain_broadcast_transaction")
return blockchain_broadcast_transaction_positional(nullptr, parameters);
if (method_name == "blockchain_btc_address_convert")
return blockchain_btc_address_convert_positional(nullptr, parameters);
if (method_name == "blockchain_get_transaction_rpc")
return blockchain_get_transaction_rpc_positional(nullptr, parameters);
if (method_name == "blockchain_set_node_vm_enabled")
return blockchain_set_node_vm_enabled_positional(nullptr, parameters);
if (method_name == "blockchain_get_node_vm_enabled")
return blockchain_get_node_vm_enabled_positional(nullptr, parameters);
if (method_name == "blockchain_get_all_contracts")
return blockchain_get_all_contracts_positional(nullptr, parameters);
if (method_name == "blockchain_get_forever_contracts")
return blockchain_get_forever_contracts_positional(nullptr, parameters);
if (method_name == "blockchain_list_pub_all_address")
return blockchain_list_pub_all_address_positional(nullptr, parameters);
if (method_name == "network_add_node")
return network_add_node_positional(nullptr, parameters);
if (method_name == "network_get_connection_count")
return network_get_connection_count_positional(nullptr, parameters);
if (method_name == "network_get_peer_info")
return network_get_peer_info_positional(nullptr, parameters);
if (method_name == "network_broadcast_transaction")
return network_broadcast_transaction_positional(nullptr, parameters);
if (method_name == "network_set_advanced_node_parameters")
return network_set_advanced_node_parameters_positional(nullptr, parameters);
if (method_name == "network_get_advanced_node_parameters")
return network_get_advanced_node_parameters_positional(nullptr, parameters);
if (method_name == "network_get_transaction_propagation_data")
return network_get_transaction_propagation_data_positional(nullptr, parameters);
if (method_name == "network_get_block_propagation_data")
return network_get_block_propagation_data_positional(nullptr, parameters);
if (method_name == "network_get_info")
return network_get_info_positional(nullptr, parameters);
if (method_name == "network_list_potential_peers")
return network_list_potential_peers_positional(nullptr, parameters);
if (method_name == "network_get_upnp_info")
return network_get_upnp_info_positional(nullptr, parameters);
if (method_name == "network_get_blocked_ips")
return network_get_blocked_ips_positional(nullptr, parameters);
if (method_name == "debug_get_client_name")
return debug_get_client_name_positional(nullptr, parameters);
if (method_name == "delegate_get_config")
return delegate_get_config_positional(nullptr, parameters);
if (method_name == "delegate_set_network_min_connection_count")
return delegate_set_network_min_connection_count_positional(nullptr, parameters);
if (method_name == "delegate_set_block_max_transaction_count")
return delegate_set_block_max_transaction_count_positional(nullptr, parameters);
if (method_name == "delegate_set_soft_max_imessage_length")
return delegate_set_soft_max_imessage_length_positional(nullptr, parameters);
if (method_name == "delegate_set_imessage_fee_coe")
return delegate_set_imessage_fee_coe_positional(nullptr, parameters);
if (method_name == "delegate_set_block_max_size")
return delegate_set_block_max_size_positional(nullptr, parameters);
if (method_name == "delegate_set_transaction_max_size")
return delegate_set_transaction_max_size_positional(nullptr, parameters);
if (method_name == "delegate_set_transaction_canonical_signatures_required")
return delegate_set_transaction_canonical_signatures_required_positional(nullptr, parameters);
if (method_name == "delegate_set_transaction_min_fee")
return delegate_set_transaction_min_fee_positional(nullptr, parameters);
if (method_name == "delegate_blacklist_add_transaction")
return delegate_blacklist_add_transaction_positional(nullptr, parameters);
if (method_name == "delegate_blacklist_remove_transaction")
return delegate_blacklist_remove_transaction_positional(nullptr, parameters);
if (method_name == "delegate_blacklist_add_operation")
return delegate_blacklist_add_operation_positional(nullptr, parameters);
if (method_name == "delegate_blacklist_remove_operation")
return delegate_blacklist_remove_operation_positional(nullptr, parameters);
if (method_name == "wallet_get_info")
return wallet_get_info_positional(nullptr, parameters);
if (method_name == "wallet_open")
return wallet_open_positional(nullptr, parameters);
if (method_name == "wallet_create")
return wallet_create_positional(nullptr, parameters);
if (method_name == "wallet_get_name")
return wallet_get_name_positional(nullptr, parameters);
if (method_name == "wallet_import_private_key")
return wallet_import_private_key_positional(nullptr, parameters);
if (method_name == "wallet_close")
return wallet_close_positional(nullptr, parameters);
if (method_name == "wallet_backup_create")
return wallet_backup_create_positional(nullptr, parameters);
if (method_name == "wallet_backup_restore")
return wallet_backup_restore_positional(nullptr, parameters);
if (method_name == "wallet_set_automatic_backups")
return wallet_set_automatic_backups_positional(nullptr, parameters);
if (method_name == "wallet_set_transaction_expiration_time")
return wallet_set_transaction_expiration_time_positional(nullptr, parameters);
if (method_name == "wallet_account_transaction_history")
return wallet_account_transaction_history_positional(nullptr, parameters);
if (method_name == "wallet_transaction_history_splite")
return wallet_transaction_history_splite_positional(nullptr, parameters);
if (method_name == "wallet_account_historic_balance")
return wallet_account_historic_balance_positional(nullptr, parameters);
if (method_name == "wallet_remove_transaction")
return wallet_remove_transaction_positional(nullptr, parameters);
if (method_name == "wallet_get_pending_transaction_errors")
return wallet_get_pending_transaction_errors_positional(nullptr, parameters);
if (method_name == "wallet_lock")
return wallet_lock_positional(nullptr, parameters);
if (method_name == "wallet_unlock")
return wallet_unlock_positional(nullptr, parameters);
if (method_name == "wallet_change_passphrase")
return wallet_change_passphrase_positional(nullptr, parameters);
if (method_name == "wallet_check_passphrase")
return wallet_check_passphrase_positional(nullptr, parameters);
if (method_name == "wallet_check_address")
return wallet_check_address_positional(nullptr, parameters);
if (method_name == "wallet_list")
return wallet_list_positional(nullptr, parameters);
if (method_name == "wallet_account_create")
return wallet_account_create_positional(nullptr, parameters);
if (method_name == "wallet_account_set_approval")
return wallet_account_set_approval_positional(nullptr, parameters);
if (method_name == "wallet_get_all_approved_accounts")
return wallet_get_all_approved_accounts_positional(nullptr, parameters);
if (method_name == "wallet_address_create")
return wallet_address_create_positional(nullptr, parameters);
if (method_name == "wallet_transfer_to_address")
return wallet_transfer_to_address_positional(nullptr, parameters);
if (method_name == "wallet_transfer_to_public_account")
return wallet_transfer_to_public_account_positional(nullptr, parameters);
if (method_name == "wallet_withdraw_from_address")
return wallet_withdraw_from_address_positional(nullptr, parameters);
if (method_name == "wallet_rescan_blockchain")
return wallet_rescan_blockchain_positional(nullptr, parameters);
if (method_name == "wallet_cancel_scan")
return wallet_cancel_scan_positional(nullptr, parameters);
if (method_name == "wallet_get_transaction")
return wallet_get_transaction_positional(nullptr, parameters);
if (method_name == "wallet_scan_transaction")
return wallet_scan_transaction_positional(nullptr, parameters);
if (method_name == "wallet_rebroadcast_transaction")
return wallet_rebroadcast_transaction_positional(nullptr, parameters);
if (method_name == "wallet_account_register")
return wallet_account_register_positional(nullptr, parameters);
if (method_name == "wallet_account_update_private_data")
return wallet_account_update_private_data_positional(nullptr, parameters);
if (method_name == "wallet_account_update_registration")
return wallet_account_update_registration_positional(nullptr, parameters);
if (method_name == "wallet_account_update_active_key")
return wallet_account_update_active_key_positional(nullptr, parameters);
if (method_name == "wallet_list_accounts")
return wallet_list_accounts_positional(nullptr, parameters);
if (method_name == "wallet_list_unregistered_accounts")
return wallet_list_unregistered_accounts_positional(nullptr, parameters);
if (method_name == "wallet_list_my_accounts")
return wallet_list_my_accounts_positional(nullptr, parameters);
if (method_name == "wallet_list_my_addresses")
return wallet_list_my_addresses_positional(nullptr, parameters);
if (method_name == "wallet_get_account")
return wallet_get_account_positional(nullptr, parameters);
if (method_name == "wallet_get_account_public_address")
return wallet_get_account_public_address_positional(nullptr, parameters);
if (method_name == "wallet_remove_contact_account")
return wallet_remove_contact_account_positional(nullptr, parameters);
if (method_name == "wallet_account_rename")
return wallet_account_rename_positional(nullptr, parameters);
if (method_name == "wallet_asset_create")
return wallet_asset_create_positional(nullptr, parameters);
if (method_name == "wallet_asset_issue")
return wallet_asset_issue_positional(nullptr, parameters);
if (method_name == "wallet_asset_issue_to_addresses")
return wallet_asset_issue_to_addresses_positional(nullptr, parameters);
if (method_name == "wallet_account_balance")
return wallet_account_balance_positional(nullptr, parameters);
if (method_name == "wallet_account_balance_ids")
return wallet_account_balance_ids_positional(nullptr, parameters);
if (method_name == "wallet_account_list_public_keys")
return wallet_account_list_public_keys_positional(nullptr, parameters);
if (method_name == "wallet_delegate_withdraw_pay")
return wallet_delegate_withdraw_pay_positional(nullptr, parameters);
if (method_name == "wallet_delegate_pay_balance_query")
return wallet_delegate_pay_balance_query_positional(nullptr, parameters);
if (method_name == "wallet_active_delegate_salary")
return wallet_active_delegate_salary_positional(nullptr, parameters);
if (method_name == "wallet_get_delegate_statue")
return wallet_get_delegate_statue_positional(nullptr, parameters);
if (method_name == "wallet_set_transaction_imessage_fee_coe")
return wallet_set_transaction_imessage_fee_coe_positional(nullptr, parameters);
if (method_name == "wallet_get_transaction_imessage_fee_coe")
return wallet_get_transaction_imessage_fee_coe_positional(nullptr, parameters);
if (method_name == "wallet_set_transaction_imessage_soft_max_length")
return wallet_set_transaction_imessage_soft_max_length_positional(nullptr, parameters);
if (method_name == "wallet_get_transaction_imessage_soft_max_length")
return wallet_get_transaction_imessage_soft_max_length_positional(nullptr, parameters);
if (method_name == "wallet_set_transaction_fee")
return wallet_set_transaction_fee_positional(nullptr, parameters);
if (method_name == "wallet_get_transaction_fee")
return wallet_get_transaction_fee_positional(nullptr, parameters);
if (method_name == "wallet_dump_private_key")
return wallet_dump_private_key_positional(nullptr, parameters);
if (method_name == "wallet_dump_account_private_key")
return wallet_dump_account_private_key_positional(nullptr, parameters);
if (method_name == "wallet_account_vote_summary")
return wallet_account_vote_summary_positional(nullptr, parameters);
if (method_name == "wallet_check_vote_status")
return wallet_check_vote_status_positional(nullptr, parameters);
if (method_name == "wallet_set_setting")
return wallet_set_setting_positional(nullptr, parameters);
if (method_name == "wallet_get_setting")
return wallet_get_setting_positional(nullptr, parameters);
if (method_name == "wallet_delegate_set_block_production")
return wallet_delegate_set_block_production_positional(nullptr, parameters);
if (method_name == "wallet_set_transaction_scanning")
return wallet_set_transaction_scanning_positional(nullptr, parameters);
if (method_name == "wallet_sign_hash")
return wallet_sign_hash_positional(nullptr, parameters);
if (method_name == "wallet_login_start")
return wallet_login_start_positional(nullptr, parameters);
if (method_name == "wallet_login_finish")
return wallet_login_finish_positional(nullptr, parameters);
if (method_name == "wallet_balance_set_vote_info")
return wallet_balance_set_vote_info_positional(nullptr, parameters);
if (method_name == "wallet_publish_slate")
return wallet_publish_slate_positional(nullptr, parameters);
if (method_name == "wallet_publish_version")
return wallet_publish_version_positional(nullptr, parameters);
if (method_name == "wallet_collect_genesis_balances")
return wallet_collect_genesis_balances_positional(nullptr, parameters);
if (method_name == "wallet_recover_accounts")
return wallet_recover_accounts_positional(nullptr, parameters);
if (method_name == "wallet_verify_titan_deposit")
return wallet_verify_titan_deposit_positional(nullptr, parameters);
if (method_name == "wallet_repair_entrys")
return wallet_repair_entrys_positional(nullptr, parameters);
if (method_name == "wallet_regenerate_keys")
return wallet_regenerate_keys_positional(nullptr, parameters);
if (method_name == "wallet_account_retract")
return wallet_account_retract_positional(nullptr, parameters);
if (method_name == "wallet_account_delete")
return wallet_account_delete_positional(nullptr, parameters);
if (method_name == "wallet_transfer_to_address_rpc")
return wallet_transfer_to_address_rpc_positional(nullptr, parameters);
if (method_name == "wallet_account_balance_rpc")
return wallet_account_balance_rpc_positional(nullptr, parameters);
if (method_name == "wallet_transfer_to_public_account_rpc")
return wallet_transfer_to_public_account_rpc_positional(nullptr, parameters);
if (method_name == "wallet_get_account_owner_publickey")
return wallet_get_account_owner_publickey_positional(nullptr, parameters);
if (method_name == "wallet_transfer_to_contract")
return wallet_transfer_to_contract_positional(nullptr, parameters);
if (method_name == "wallet_transfer_to_contract_testing")
return wallet_transfer_to_contract_testing_positional(nullptr, parameters);
if (method_name == "wallet_get_contracts")
return wallet_get_contracts_positional(nullptr, parameters);
if (method_name == "wallet_scan_contracts")
return wallet_scan_contracts_positional(nullptr, parameters);
if (method_name == "about")
return about_positional(nullptr, parameters);
if (method_name == "get_info")
return get_info_positional(nullptr, parameters);
if (method_name == "stop")
return stop_positional(nullptr, parameters);
if (method_name == "help")
return help_positional(nullptr, parameters);
if (method_name == "validate_address")
return validate_address_positional(nullptr, parameters);
if (method_name == "execute_command_line")
return execute_command_line_positional(nullptr, parameters);
if (method_name == "execute_script")
return execute_script_positional(nullptr, parameters);
if (method_name == "batch")
return batch_positional(nullptr, parameters);
if (method_name == "batch_authenticated")
return batch_authenticated_positional(nullptr, parameters);
if (method_name == "builder_finalize_and_sign")
return builder_finalize_and_sign_positional(nullptr, parameters);
if (method_name == "meta_help")
return meta_help_positional(nullptr, parameters);
if (method_name == "rpc_set_username")
return rpc_set_username_positional(nullptr, parameters);
if (method_name == "rpc_set_password")
return rpc_set_password_positional(nullptr, parameters);
if (method_name == "rpc_start_server")
return rpc_start_server_positional(nullptr, parameters);
if (method_name == "http_start_server")
return http_start_server_positional(nullptr, parameters);
if (method_name == "ntp_update_time")
return ntp_update_time_positional(nullptr, parameters);
if (method_name == "disk_usage")
return disk_usage_positional(nullptr, parameters);
if (method_name == "compile_contract")
return compile_contract_positional(nullptr, parameters);
if (method_name == "register_contract")
return register_contract_positional(nullptr, parameters);
if (method_name == "register_contract_testing")
return register_contract_testing_positional(nullptr, parameters);
if (method_name == "upgrade_contract")
return upgrade_contract_positional(nullptr, parameters);
if (method_name == "upgrade_contract_testing")
return upgrade_contract_testing_positional(nullptr, parameters);
if (method_name == "destroy_contract")
return destroy_contract_positional(nullptr, parameters);
if (method_name == "destroy_contract_testing")
return destroy_contract_testing_positional(nullptr, parameters);
if (method_name == "call_contract")
return call_contract_positional(nullptr, parameters);
if (method_name == "get_contract_info")
return get_contract_info_positional(nullptr, parameters);
if (method_name == "get_contract_balance")
return get_contract_balance_positional(nullptr, parameters);
if (method_name == "call_contract_testing")
return call_contract_testing_positional(nullptr, parameters);
if (method_name == "call_contract_offline")
return call_contract_offline_positional(nullptr, parameters);
if (method_name == "load_contract_to_file")
return load_contract_to_file_positional(nullptr, parameters);
if (method_name == "get_result_trx_id")
return get_result_trx_id_positional(nullptr, parameters);
if (method_name == "get_request_trx_id")
return get_request_trx_id_positional(nullptr, parameters);
if (method_name == "sandbox_open")
return sandbox_open_positional(nullptr, parameters);
if (method_name == "sandbox_close")
return sandbox_close_positional(nullptr, parameters);
if (method_name == "sandbox_register_contract")
return sandbox_register_contract_positional(nullptr, parameters);
if (method_name == "sandbox_call_contract")
return sandbox_call_contract_positional(nullptr, parameters);
if (method_name == "sandbox_upgrade_contract")
return sandbox_upgrade_contract_positional(nullptr, parameters);
if (method_name == "sandbox_upgrade_contract_testing")
return sandbox_upgrade_contract_testing_positional(nullptr, parameters);
if (method_name == "sandbox_destroy_contract")
return sandbox_destroy_contract_positional(nullptr, parameters);
if (method_name == "sandbox_destroy_contract_testing")
return sandbox_destroy_contract_testing_positional(nullptr, parameters);
if (method_name == "sandbox_get_contract_info")
return sandbox_get_contract_info_positional(nullptr, parameters);
if (method_name == "sandbox_get_contract_balance")
return sandbox_get_contract_balance_positional(nullptr, parameters);
if (method_name == "sandbox_transfer_to_contract")
return sandbox_transfer_to_contract_positional(nullptr, parameters);
if (method_name == "sandbox_account_balance")
return sandbox_account_balance_positional(nullptr, parameters);
if (method_name == "sandbox_compile_contract")
return sandbox_compile_contract_positional(nullptr, parameters);
if (method_name == "sandbox_load_contract_to_file")
return sandbox_load_contract_to_file_positional(nullptr, parameters);
if (method_name == "sandbox_register_contract_testing")
return sandbox_register_contract_testing_positional(nullptr, parameters);
if (method_name == "sandbox_call_contract_testing")
return sandbox_call_contract_testing_positional(nullptr, parameters);
if (method_name == "sandbox_transfer_to_contract_testing")
return sandbox_transfer_to_contract_testing_positional(nullptr, parameters);
if (method_name == "sandbox_list_my_addresses")
return sandbox_list_my_addresses_positional(nullptr, parameters);
if (method_name == "get_contract_registered_in_transaction")
return get_contract_registered_in_transaction_positional(nullptr, parameters);
if (method_name == "get_transaction_id_contract_registered")
return get_transaction_id_contract_registered_positional(nullptr, parameters);
if (method_name == "get_contract_info_from_gpc_file")
return get_contract_info_from_gpc_file_positional(nullptr, parameters);
if (method_name == "compile_script")
return compile_script_positional(nullptr, parameters);
if (method_name == "add_script")
return add_script_positional(nullptr, parameters);
if (method_name == "remove_script")
return remove_script_positional(nullptr, parameters);
if (method_name == "get_script_info")
return get_script_info_positional(nullptr, parameters);
if (method_name == "list_scripts")
return list_scripts_positional(nullptr, parameters);
if (method_name == "disable_script")
return disable_script_positional(nullptr, parameters);
if (method_name == "enable_script")
return enable_script_positional(nullptr, parameters);
if (method_name == "import_script_db")
return import_script_db_positional(nullptr, parameters);
if (method_name == "export_script_db")
return export_script_db_positional(nullptr, parameters);
if (method_name == "get_events_bound")
return get_events_bound_positional(nullptr, parameters);
if (method_name == "list_event_handler")
return list_event_handler_positional(nullptr, parameters);
if (method_name == "add_event_handler")
return add_event_handler_positional(nullptr, parameters);
if (method_name == "delete_event_handler")
return delete_event_handler_positional(nullptr, parameters);
if (method_name == "store_file_to_network")
return store_file_to_network_positional(nullptr, parameters);
if (method_name == "get_file_access")
return get_file_access_positional(nullptr, parameters);
if (method_name == "store_file_piece")
return store_file_piece_positional(nullptr, parameters);
if (method_name == "store_reject")
return store_reject_positional(nullptr, parameters);
if (method_name == "wallet_set_node_id")
return wallet_set_node_id_positional(nullptr, parameters);
if (method_name == "blockchain_list_file_saved")
return blockchain_list_file_saved_positional(nullptr, parameters);
if (method_name == "blockchain_get_file_authorizing_contract")
return blockchain_get_file_authorizing_contract_positional(nullptr, parameters);
if (method_name == "wallet_list_store_request_for_my_file")
return wallet_list_store_request_for_my_file_positional(nullptr, parameters);
if (method_name == "blockchain_check_signature")
return blockchain_check_signature_positional(nullptr, parameters);
if (method_name == "wallet_get_my_access")
return wallet_get_my_access_positional(nullptr, parameters);
if (method_name == "wallet_get_my_upload_requests")
return wallet_get_my_upload_requests_positional(nullptr, parameters);
if (method_name == "wallet_get_my_store_request")
return wallet_get_my_store_request_positional(nullptr, parameters);
if (method_name == "wallet_get_my_store_confirmed")
return wallet_get_my_store_confirmed_positional(nullptr, parameters);
if (method_name == "wallet_get_my_store_rejected")
return wallet_get_my_store_rejected_positional(nullptr, parameters);
if (method_name == "blockchain_get_file_save_node")
return blockchain_get_file_save_node_positional(nullptr, parameters);
FC_ASSERT(false, "shouldn't happen");
}
} } // end namespace TiValue::rpc_stubs
| [
"ttxsdog@gmail.com"
] | ttxsdog@gmail.com |
cd4a432218a146660cca20a32b31cb20f6d6f402 | c361ebf398179720b7e153df205730a14e4edd3b | /include/headers.h | d4998e4457431509b3f5ba6f490c4a42a69c617f | [] | no_license | cpp-people/ascii-eng | f64b8de52aee37d942c87a768c3e223c3af696fa | fa2157c21966f9c77e9ca75b1a80f486900eaf64 | refs/heads/main | 2023-03-21T06:38:09.481258 | 2021-03-20T22:15:07 | 2021-03-20T22:15:07 | 347,453,088 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 96 | h | #ifndef HEADERS_H
#define HEADERS_H
#include <iostream>
#include <string>
#endif // HEADERS_H
| [
"dreamviolent56@gmail.com"
] | dreamviolent56@gmail.com |
dae74bd0590130401c837c3ab1390ab90202c015 | c8e9b7d79d19c621b6d72fb57e15ed9cf6ed05d1 | /dataUnf/code/PlotRatios_DataUnfolded_afterDiag_newNominal.cc | 5487c00b2fbd1881f7e6474904501a8cd6067d7a | [] | no_license | InnaKucher/unfolding_HIN_18_012 | 6220d0ff6cbbd8dd551f888adbe234b86be7d421 | 2fb70bda94131dbe0c17a12539fe89f45f7c4ea6 | refs/heads/master | 2020-03-20T00:50:56.785563 | 2018-06-12T11:20:53 | 2018-06-12T11:20:53 | 137,057,744 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 9,429 | cc | #include "TROOT.h"
#include "TKey.h"
#include "TFile.h"
#include "TSystem.h"
#include "TCanvas.h"
#include "TTree.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TObjArray.h"
#include "THStack.h"
#include "TLegend.h"
#include "TEfficiency.h"
#include "TGraphAsymmErrors.h"
#include "TF1.h"
#include "TMath.h"
#include "TCut.h"
#include "TPaletteAxis.h"
#include "TBranchElement.h"
#include "TPaveStats.h"
#include "TLatex.h"
#include "TStyle.h"
#include "TLorentzVector.h"
#include "TClonesArray.h"
#include "TProfile.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;
void plot(bool doPrompt = true, bool doMid = false){
string filename1 = "";
string filename2 = "";
string filename3 = "";
string filename4 = "";
string filenameMeas = "";
string outputfile = "";
if(doPrompt && doMid){
cout << "prompt mid" << endl;
filename1 = "../unfOutput/step1/UnfoldedDistributions_Prompt_Mid_8iter_49z15ptBins7zMeasBins_newNominal_nominal_Diag.root";
filename2 = "../unfOutput/step2/UnfoldedDistributions_Prompt_Mid_8iter_49z15ptBins7zMeasBins_newNominal_nominal_Diag.root";
filename3 = "../unfOutput/step3/UnfoldedDistributions_Prompt_Mid_8iter_49z15ptBins7zMeasBins_newNominal_nominal_Diag.root";
filename4 = "../unfOutput/step4/UnfoldedDistributions_Prompt_Mid_8iter_49z15ptBins7zMeasBins_newNominal_nominal_Diag.root";
filenameMeas = "../unfOutput/step3/UnfoldedDistributions_Prompt_Mid_8iter_49z15ptBins7zMeasBins_newNominal_nominal.root";
outputfile = "unfResult_prompt_mid_newNominal.root";
}
if(doPrompt && !doMid){
cout << "prompt fwd" << endl;
filename1 ="../unfOutput/step1/UnfoldedDistributions_Prompt_Fwd_8iter_50z15ptBins_newNominal_nominal_Diag.root";
filename2 ="../unfOutput/step2/UnfoldedDistributions_Prompt_Fwd_8iter_50z15ptBins_newNominal_nominal_Diag.root";
filename3 ="../unfOutput/step3/UnfoldedDistributions_Prompt_Fwd_8iter_50z15ptBins_newNominal_nominal_Diag.root";
filename4 ="../unfOutput/step4/UnfoldedDistributions_Prompt_Fwd_8iter_50z15ptBins_newNominal_nominal_Diag.root";
filenameMeas = "../unfOutput/step3/UnfoldedDistributions_Prompt_Fwd_8iter_50z15ptBins_newNominal_nominal.root";
outputfile = "unfResult_prompt_fwd_newNominal.root";
}
if(!doPrompt && doMid){
cout << "prompt mid" << endl;
filename1 = "../unfOutput/step1/UnfoldedDistributions_NonPrompt_Mid_8iter_49z15ptBins7zMeasBins_nominal_Diag.root";
filename2 = "../unfOutput/step2/UnfoldedDistributions_NonPrompt_Mid_8iter_49z15ptBins7zMeasBins_nominal_Diag.root";
filename3 = "../unfOutput/step3/UnfoldedDistributions_NonPrompt_Mid_8iter_49z15ptBins7zMeasBins_nominal_Diag.root";
filename4 = "../unfOutput/step4/UnfoldedDistributions_NonPrompt_Mid_8iter_49z15ptBins7zMeasBins_nominal_Diag.root";
filenameMeas = "../unfOutput/step3/UnfoldedDistributions_NonPrompt_Mid_8iter_49z15ptBins7zMeasBins_nominal.root";
outputfile = "unfResult_nonprompt_mid.root";
}
if(!doPrompt && !doMid){
cout << "prompt fwd" << endl;
filename1 ="../unfOutput/step1/UnfoldedDistributions_NonPrompt_Fwd_8iter_50z15ptBins_nominal_Diag.root";
filename2 ="../unfOutput/step2/UnfoldedDistributions_NonPrompt_Fwd_8iter_50z15ptBins_nominal_Diag.root";
filename3 ="../unfOutput/step3/UnfoldedDistributions_NonPrompt_Fwd_8iter_50z15ptBins_nominal_Diag.root";
filename4 ="../unfOutput/step4/UnfoldedDistributions_NonPrompt_Fwd_8iter_50z15ptBins_nominal_Diag.root";
filenameMeas = "../unfOutput/step3/UnfoldedDistributions_NonPrompt_Fwd_8iter_50z15ptBins_nominal.root";
outputfile = "unfResult_nonprompt_fwd.root";
}
TFile *file1 = new TFile(filename1.c_str());
TFile *file2 = new TFile(filename2.c_str());
TFile *file3 = new TFile(filename3.c_str());
TFile *file4 = new TFile(filename4.c_str());
TFile *fileMeas = new TFile(filenameMeas.c_str());
TH2D *h2ZMeas;
h2ZMeas=(TH2D*)fileMeas->Get("fh2MeasData;1");
TH1D *hZMeas = h2ZMeas->ProjectionX("hZMeas",2,2);
hZMeas->Draw();
TH2D *h2UnfResp1 = (TH2D*)file1->Get("hReco_Iter1;1");
TH2D *h2UnfResp2 = (TH2D*)file2->Get("hReco_Iter1;1");
TH2D *h2UnfResp3 = (TH2D*)file3->Get("hReco_Iter1;1");
TH2D *h2UnfResp4 = (TH2D*)file4->Get("hReco_Iter1;1");
TH1D *hZUnf_SI1 = (TH1D*)h2UnfResp1->ProjectionX("hZUnf_SI1",2,2);
TH1D *hZUnf_SI2 = (TH1D*)h2UnfResp2->ProjectionX("hZUnf_SI2",2,2);
TH1D *hZUnf_SI3 = (TH1D*)h2UnfResp3->ProjectionX("hZUnf_SI3",2,2);
TH1D *hZUnf_SI4 = (TH1D*)h2UnfResp4->ProjectionX("hZUnf_SI4",2,2);
TH1D *hZUnf_SI1_ratioMeas;
TH1D *hZUnf_SI2_ratioMeas;
TH1D *hZUnf_SI3_ratioMeas;
TH1D *hZUnf_SI4_ratioMeas;
hZUnf_SI1_ratioMeas = (TH1D*)hZUnf_SI1->Clone("hZUnf_SI1_ratioMeas");
hZUnf_SI1_ratioMeas->Divide(hZMeas);
hZUnf_SI2_ratioMeas = (TH1D*)hZUnf_SI2->Clone("hZUnf_SI2_ratioMeas");
hZUnf_SI2_ratioMeas->Divide(hZMeas);
hZUnf_SI3_ratioMeas = (TH1D*)hZUnf_SI3->Clone("hZUnf_SI3_ratioMeas");
hZUnf_SI3_ratioMeas->Divide(hZMeas);
hZUnf_SI4_ratioMeas = (TH1D*)hZUnf_SI4->Clone("hZUnf_SI4_ratioMeas");
hZUnf_SI4_ratioMeas->Divide(hZMeas);
TCanvas * mycan1 = new TCanvas("mycan1","mycan1",900,500);
mycan1->Divide(2,1);
TLegend *legend = new TLegend(0.8,0.15,.95,0.9,"","brNDC");
legend->SetHeader("");
legend->SetBorderSize(0);
legend->SetFillStyle(0);
legend->SetTextFont(42);
legend->SetTextSize(0.04);
mycan1->cd(1);
gPad->SetLeftMargin(0.12);
gPad->SetRightMargin(0.2);
hZMeas->SetStats(0);
if(doPrompt & doMid){
hZMeas->SetTitle("prompt mid-rapidity");
}
if(doPrompt & !doMid){
hZMeas->SetTitle("prompt fow-rapidity");
}
if(!doPrompt & doMid){
hZMeas->SetTitle("nonprompt mid-rapidity");
}
if(!doPrompt & !doMid){
hZMeas->SetTitle("nonprompt fow-rapidity");
}
if(doPrompt && !doMid) hZMeas->SetMaximum(hZMeas->GetMaximum()*1.5);
else hZMeas->SetMaximum(hZMeas->GetMaximum()*1.3);
hZMeas->GetXaxis()->SetTitle("z");
hZMeas->GetYaxis()->SetTitleOffset(1.9);
hZMeas->GetYaxis()->SetTitle("dN/dz (per 0.2)");
if(doMid) hZMeas->GetYaxis()->SetTitle("dN/dz (per 0.14)");
hZMeas->SetLineColor(kBlack);
hZMeas->SetMarkerColor(kBlack);
hZMeas->SetMarkerStyle(28);
hZMeas->SetMarkerSize(1.5);
hZUnf_SI1->SetLineColor(kgreen);
hZUnf_SI2->SetLineColor(kazure);
hZUnf_SI3->SetLineColor(kred);
hZUnf_SI4->SetLineColor(kpink);
hZUnf_SI1->SetMarkerColor(kgreen);
hZUnf_SI2->SetMarkerColor(kazure);
hZUnf_SI3->SetMarkerColor(kred);
hZUnf_SI4->SetMarkerColor(kpink);
hZUnf_SI1->SetMarkerStyle(24);
hZUnf_SI2->SetMarkerStyle(25);
hZUnf_SI3->SetMarkerStyle(22);
hZUnf_SI4->SetMarkerStyle(30);
hZUnf_SI1->SetMarkerSize(1.5);
hZUnf_SI2->SetMarkerSize(1.5);
hZUnf_SI3->SetMarkerSize(1.5);
hZUnf_SI4->SetMarkerSize(1.5);
hZMeas->Draw("EP");
hZUnf_SI1->Draw("EPsame");
hZUnf_SI2->Draw("EPsame");
hZUnf_SI3->Draw("EPsame");
hZUnf_SI4->Draw("EPsame");
legend->AddEntry(hZMeas, "meas","ep");
legend->AddEntry(hZUnf_SI1, "unf SI#1","ep");
legend->AddEntry(hZUnf_SI2, "unf SI#2","ep");
legend->AddEntry(hZUnf_SI3, "unf SI#3","ep");
legend->AddEntry(hZUnf_SI4, "unf SI#4","ep");
legend->Draw("same");
mycan1->Update();
float xCoord;
if(doMid) xCoord = 0.44;
else xCoord = 0.2;
TLine *line0 = new TLine(xCoord,0,xCoord,gPad->GetUymax());
line0->SetLineColor(kred);
line0->SetLineStyle(2);
line0->SetLineWidth(2);
line0->Draw("same");
mycan1->cd(2);
//gPad->SetRightMargin(0.2);
hZUnf_SI1_ratioMeas->SetStats(0);
hZUnf_SI1_ratioMeas->GetYaxis()->SetTitle("ratio to measured");
hZUnf_SI1_ratioMeas->GetYaxis()->SetRangeUser(0.,1.4);
// if(doMid) hZUnf_SI1_ratioMeas->GetXaxis()->SetRangeUser(0.4,1.);
//else hZUnf_SI1_ratioMeas->GetXaxis()->SetRangeUser(0.2,1.);
hZUnf_SI1_ratioMeas->GetXaxis()->SetTitle("z");
hZUnf_SI1_ratioMeas->SetLineColor(kgreen);
hZUnf_SI2_ratioMeas->SetLineColor(kazure);
hZUnf_SI3_ratioMeas->SetLineColor(kred);
hZUnf_SI4_ratioMeas->SetLineColor(kpink);
hZUnf_SI1_ratioMeas->SetMarkerColor(kgreen);
hZUnf_SI2_ratioMeas->SetMarkerColor(kazure);
hZUnf_SI3_ratioMeas->SetMarkerColor(kred);
hZUnf_SI4_ratioMeas->SetMarkerColor(kpink);
hZUnf_SI3_ratioMeas->SetLineStyle(1);
hZUnf_SI3_ratioMeas->SetLineWidth(2);
hZUnf_SI4_ratioMeas->SetLineStyle(8);
hZUnf_SI4_ratioMeas->SetLineWidth(2);
hZUnf_SI1_ratioMeas->Draw("HIST");
hZUnf_SI2_ratioMeas->Draw("HISTsame");
hZUnf_SI3_ratioMeas->Draw("HISTsame");
hZUnf_SI4_ratioMeas->Draw("HISTsame");
mycan1->Update();
TLine *line1 = new TLine(xCoord,0,xCoord,gPad->GetUymax());
line1->SetLineColor(kred);
line1->SetLineStyle(2);
line1->SetLineWidth(2);
line1->Draw("same");
mycan1->Update();
if(doPrompt && doMid){
mycan1->SaveAs("../plots/unf_data_prompt_mid_49z15ptBins7zMeasBins_new_nominal_Diag.pdf");
}
if(doPrompt && !doMid){
mycan1->SaveAs("../plots/unf_data_prompt_fwd_50z15ptBins_new_nominal_Diag.pdf");
}
if(!doPrompt && doMid){
mycan1->SaveAs("../plots/unf_data_nonprompt_mid_49z15ptBins7zMeasBins_nominal_Diag.pdf");
}
if(!doPrompt && !doMid){
mycan1->SaveAs("../plots/unf_data_nonprompt_fwd_50z15ptBins_nominal_Diag.pdf");
}
}
void PlotRatios_DataUnfolded_afterDiag_newNominal(){
//plot(true,true);
plot(true,false);
}
| [
"inna.kucher@cern.ch"
] | inna.kucher@cern.ch |
e1256504732cb675233c3c5b401ebcb6b8191afc | 6816da268212d4575d83fad24c3e3dc3430a1804 | /1222_7097007(AC).cpp | e1aeb68ed71d5436bcd711ab2bb583e7380626a8 | [] | no_license | JunKiBeom/codeup.kr | 3389f643369724920610b4137394c46772f6a1fc | aae95a1fee11d352952518d8d0ea3a06b3334973 | refs/heads/master | 2022-08-26T13:20:24.074622 | 2022-08-20T11:26:46 | 2022-08-20T11:26:46 | 175,571,319 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 272 | cpp | #include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
while (a<90)
{
b++;
a+=5;
}
if (b>c)
cout<<"win";
else if (b==c)
cout<<"same";
else
cout<<"lose";
}
| [
"dona0408@gmail.com"
] | dona0408@gmail.com |
0b0e2b85d2231f52edfc178c140cb209b8c3dc21 | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /sae/include/alibabacloud/sae/model/DeleteApplicationRequest.h | 73876af0652aa6d6834e34428a5b239657a86e72 | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 1,360 | h | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_SAE_MODEL_DELETEAPPLICATIONREQUEST_H_
#define ALIBABACLOUD_SAE_MODEL_DELETEAPPLICATIONREQUEST_H_
#include <alibabacloud/sae/SaeExport.h>
#include <alibabacloud/core/RoaServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Sae {
namespace Model {
class ALIBABACLOUD_SAE_EXPORT DeleteApplicationRequest : public RoaServiceRequest {
public:
DeleteApplicationRequest();
~DeleteApplicationRequest();
std::string getAppId() const;
void setAppId(const std::string &appId);
private:
std::string appId_;
};
} // namespace Model
} // namespace Sae
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SAE_MODEL_DELETEAPPLICATIONREQUEST_H_
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
6a842ee1cb51dd7878e1f0b38b711019a56e434d | e838c6316a1d33959036664cb4ec7cc21b4fd7c2 | /os/rsc_mgr/rsc_mgr.cc | b3811054193a91b90248e61ba8ad079a6e23a260 | [] | no_license | weiang/src | fb9bfa7c1045db289ac65b40ed94c8f70a807d46 | f0ef5c73c6f4e0a02f3d21964a2ac37141b4bc36 | refs/heads/master | 2020-05-17T04:20:16.058900 | 2013-11-13T15:37:33 | 2013-11-13T15:37:33 | 13,587,343 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,264 | cc | #include <pthread.h>
#include <iostream>
#include "./rsc_mgr.h"
#include <stdlib.h>
#include <stdio.h>
using namespace std;
void rsc_mgr::request(int i)
{
pthread_mutex_lock(&mutex);
// cout << " In thread: " << pthread_self() << "'s Request function!" << endl;
if (i > total) {
cerr << "Request error!" << endl;
pthread_mutex_unlock(&mutex);
exit(1);
}
if (avail < i) {
struct blk_que *p = new struct blk_que;
p -> qst = i;
pthread_mutex_init(&(p -> thd_blk), NULL);
p -> next = queue -> next;
queue -> next = p;
pthread_mutex_lock(&(p -> thd_blk)); // Block the thread
cout << "Blocked!" << endl;
}
else {
avail -= i;
}
pthread_mutex_unlock(&mutex);
}
void rsc_mgr::release(int i)
{
pthread_mutex_lock(&mutex);
// cout << "In thread: " << pthread_self() << "'s Release function!" << endl;
avail += i;
sched();
pthread_mutex_unlock(&mutex);
}
void rsc_mgr::sched()
{
pthread_mutex_lock(&mutex);
struct blk_que *q = queue -> next;
struct blk_que *preq = queue;
while (q != NULL) {
if (q -> qst <= avail) {
avail -= q -> qst;
pthread_mutex_unlock(&(q -> thd_blk));
pthread_mutex_destroy(&(q -> thd_blk));
preq -> next = q -> next;
delete q;
break;
}
else {
preq = q;
q = q -> next;
}
}
}
| [
"weiang@mail.ustc.edu.cn"
] | weiang@mail.ustc.edu.cn |
eb0405027dc83f9d895ffd93fa37529068bba6de | 10eebdbf82124368580f0abe824db3faa8e0234c | /王道/4数学问题/106a+b(高精度整数).cpp | 923fcb25a96dcdedf722d07d7199c52f13a1066c | [] | no_license | Yun-Peng-Wang/oj | e7f696d500fce223319e58ab2921e4cbced183df | 75faa5708aa792a90b1e39ee06402a63ef625e8e | refs/heads/main | 2023-07-09T09:42:03.592197 | 2021-08-13T16:39:50 | 2021-08-13T16:39:50 | 390,660,840 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,654 | cpp | //https://www.nowcoder.com/practice/4c39c984ea3848b48e111b8e71ec1dd4?tpId=40&&tqId=21541&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan/question-ranking
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
const int bitMax = 1010;
class bigInteger {
private:
int bigNum[bitMax + 1];
int bigNumSize;
public:
bigInteger();//构造函数,初始化
void strToBigNum(char str[]);//将字符串转到bigNum中,低位放前面
void outPrint();//输出
friend bigInteger operator + (const bigInteger& a, const bigInteger& b);//友元函数重载+
};
bigInteger::bigInteger() {
for (int i = 0; i <= bitMax; i++)bigNum[i] = 0;
bigNumSize = 0;
}
void bigInteger::strToBigNum(char str[]) {
int strSize = strlen(str);
for (int i = strSize - 1; i >= 0; i--) {
bigNum[bigNumSize++] = str[i] - '0';
}
}
void bigInteger::outPrint() {
for (int i = bigNumSize - 1; i >= 0; i--)
cout << bigNum[i];
cout << endl;
}
bigInteger operator + (const bigInteger& a, const bigInteger& b) {
bigInteger ans;
int carry = 0;//进位
for (int i = 0; i < a.bigNumSize || i < b.bigNumSize; i++) {
int tmp = a.bigNum[i] + b.bigNum[i] + carry;//记得加上进位的
carry = tmp / 10;
ans.bigNum[ans.bigNumSize++] = tmp % 10;
}
if (carry != 0) {
ans.bigNum[ans.bigNumSize++] = carry;
}
return ans;
}
int main() {
char aStr[bitMax + 1], bStr[bitMax + 1];
while (cin >> aStr >> bStr) {
bigInteger a, b, c;
a.strToBigNum(aStr);
b.strToBigNum(bStr);
c = a + b;
c.outPrint();
}
return 0;
}
| [
"2217236949@qq.com"
] | 2217236949@qq.com |
20661d6dcd2fdce0a55eb37ece257317758d9d05 | 9e4e701ab0cbccd4d0698c3f9b7d9ba1f7463447 | /LiquidCoreiOS/LiquidCore/V82JSC/Value.cpp | fed7904f39340a0cf3cbf7ddfd2196d70308b4ba | [
"MIT"
] | permissive | eachscape/LiquidCore | 5b7235214af38f57423809a5c01ea52df62c6d2b | 12f92c410c28fbc11553e239fb2c16961e00698c | refs/heads/master | 2020-05-07T10:30:12.760322 | 2019-04-09T17:26:00 | 2019-04-09T17:26:00 | 180,413,109 | 0 | 0 | null | 2019-04-09T17:00:38 | 2019-04-09T17:00:37 | null | UTF-8 | C++ | false | false | 20,792 | cpp | /*
* Copyright (c) 2018 Eric Lange
*
* Distributed under the MIT License. See LICENSE.md at
* https://github.com/LiquidPlayer/LiquidCore for terms and conditions.
*/
#include "V82JSC.h"
#include "JSObjectRefPrivate.h"
#include "Value.h"
#include "StringImpl.h"
using namespace V82JSC;
using v8::Local;
using v8::EscapableHandleScope;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Isolate;
inline bool is__(const v8::Value* thiz, const char *code_)
{
v8::HandleScope scope(v8::Isolate::GetCurrent());
v8::Local<v8::Context> context = ToCurrentContext(thiz);
auto ctx = ToContextRef(context);
auto v = ToJSValueRef<v8::Value>(thiz, context);
JSValueRef b = exec(ctx, code_, 1, &v);
bool ret = JSValueToBoolean(ctx, b);
return ret;
}
#define IS(name_,code_) bool v8::Value::name_() const { return is__(this, code_); }
Local<v8::Value> Value::New(const Context *ctx, JSValueRef value, BaseMap *map)
{
JSType t = JSValueGetType(ctx->m_ctxRef, value);
IsolateImpl* isolateimpl = ToIsolateImpl(ctx);
v8::Isolate *isolate = ToIsolate(isolateimpl);
typedef v8::internal::Heap::RootListIndex R;
v8::internal::Object * io;
void* resource = nullptr;
EscapableHandleScope scope(isolate);
double num = 0.0;
if (!map) {
switch (t) {
case kJSTypeUndefined: {
io = isolateimpl->ii.heap()->root(R::kUndefinedValueRootIndex);
return scope.Escape(CreateLocal<v8::Value>(isolate, FromHeapPointer(io)));
}
case kJSTypeNull: {
io = isolateimpl->ii.heap()->root(R::kNullValueRootIndex);
return scope.Escape(CreateLocal<v8::Value>(isolate, FromHeapPointer(io)));
}
case kJSTypeBoolean: {
if (JSValueToBoolean(ctx->m_ctxRef, value))
io = isolateimpl->ii.heap()->root(R::kTrueValueRootIndex);
else
io = isolateimpl->ii.heap()->root(R::kFalseValueRootIndex);
return scope.Escape(CreateLocal<v8::Value>(isolate, FromHeapPointer(io)));
}
case kJSTypeString: {
if (isolateimpl->m_external_strings.count(value) == 1) {
Local<v8::WeakExternalString> wes = isolateimpl->m_external_strings[value].Get(isolate);
auto ext = ToImpl<WeakExternalString>(wes);
map = reinterpret_cast<BaseMap*>(FromHeapPointer(ext->m_map));
resource = ext->m_resource;
} else {
map = isolateimpl->m_string_map;
}
break;
}
case kJSTypeNumber: {
num = JSValueToNumber(ctx->m_ctxRef, value, 0);
double intpart;
if (value != isolateimpl->m_negative_zero && modf(num, &intpart) == 0.0) {
if (v8::internal::Smi::IsValid(intpart)) {
return scope.Escape(CreateLocalSmi<v8::Value>(reinterpret_cast<v8::internal::Isolate*>(isolateimpl),
v8::internal::Smi::FromInt(intpart)));
}
}
map = isolateimpl->m_number_map;
break;
}
case kJSTypeObject: {
if (isolateimpl->m_jsobjects.count((JSObjectRef)value)) {
auto obj = isolateimpl->m_jsobjects[(JSObjectRef)value];
return scope.Escape(CreateLocal<v8::Value>(isolate, obj));
}
JSValueRef proxyless = JSObjectGetProxyTarget((JSObjectRef)value);
if (proxyless == 0) proxyless = value;
JSValueRef exception = 0;
JSValueRef isArrayBuffer = exec(ctx->m_ctxRef, "return _1 instanceof ArrayBuffer", 1, &proxyless, &exception);
if (!exception && JSValueToBoolean(ctx->m_ctxRef, isArrayBuffer)) {
map = isolateimpl->m_array_buffer_map;
} else {
exception = 0;
JSValueRef isSymbol = exec(ctx->m_ctxRef, "return typeof _1 === 'symbol'", 1, &proxyless, &exception);
if (!exception && JSValueToBoolean(ctx->m_ctxRef, isSymbol)) {
map = isolateimpl->m_symbol_map;
} else {
map = isolateimpl->m_value_map;
}
}
break;
}
default:
break;
}
}
assert(map);
auto impl = static_cast<Value *>(HeapAllocator::Alloc(isolateimpl, map));
impl->m_value = value;
if (t == kJSTypeString) {
* reinterpret_cast<void**>(reinterpret_cast<intptr_t>(impl) +
v8::internal::Internals::kStringResourceOffset) = resource;
}
JSValueProtect(ctx->m_ctxRef, impl->m_value);
if (t == kJSTypeNumber) {
reinterpret_cast<v8::internal::HeapNumber*>(ToHeapPointer(impl))->set_value(num);
}
if (t == kJSTypeObject) {
isolateimpl->m_jsobjects[(JSObjectRef)value] = impl;
}
return scope.Escape(CreateLocal<v8::Value>(ToIsolate(isolateimpl), impl));
}
void Value::RemoveObjectFromMap(IsolateImpl* iso, JSObjectRef o)
{
iso->m_jsobjects.erase(o);
}
#define FROMTHIS(c,v) \
auto cc = ToCurrentContext(this); \
auto c = ToContextImpl(cc); \
auto v = ToJSValueRef<Value>(this, cc)
/**
* Returns true if this value is true.
*/
bool v8::Value::IsTrue() const { FROMTHIS(c,v); return JSValueIsStrictEqual(c->m_ctxRef, v, JSValueMakeBoolean(c->m_ctxRef, true)); }
/**
* Returns true if this value is false.
*/
bool v8::Value::IsFalse() const { FROMTHIS(c,v); return JSValueIsStrictEqual(c->m_ctxRef, v, JSValueMakeBoolean(c->m_ctxRef, false)); }
/**
* Returns true if this value is a symbol or a string.
*/
bool v8::Value::IsName() const { return IsString() || IsSymbol(); }
/**
* Returns true if this value is a symbol.
*/
IS(IsSymbol, "return typeof _1 === 'symbol'")
/**
* Returns true if this value is a function.
*/
IS(IsFunction, "return typeof _1 === 'function'")
/**
* Returns true if this value is an array. Note that it will return false for
* an Proxy for an array.
*/
bool v8::Value::IsArray() const { FROMTHIS(c,v); return JSValueIsArray(c->m_ctxRef, v); }
/**
* Returns true if this value is an object.
*/
bool v8::Value::IsObject() const { FROMTHIS(c,v); return JSValueIsObject(c->m_ctxRef, v); }
/**
* Returns true if this value is boolean.
*/
bool v8::Value::IsBoolean() const { FROMTHIS(c,v); return JSValueIsBoolean(c->m_ctxRef, v); }
/**
* Returns true if this value is a number.
*/
bool v8::Value::IsNumber() const { FROMTHIS(c,v); return JSValueIsNumber(c->m_ctxRef, v); }
/**
* Returns true if this value is external.
*/
IS(IsExternal, "return Object.prototype.toString.call( _1 ) === '[object External]';")
/**
* Returns true if this value is a 32-bit signed integer.
*/
bool v8::Value::IsInt32() const
{
HandleScope scope(Isolate::GetCurrent());
MaybeLocal<Number> num = ToNumber();
if (!num.IsEmpty()) {
FROMTHIS(c,v);
JSValueRef exception = nullptr;
double number = JSValueToNumber(c->m_ctxRef, v, &exception);
double intpart;
if (v == ToIsolateImpl(c)->m_negative_zero) return false;
if (std::modf(number, &intpart) == 0.0) {
return (intpart >= std::numeric_limits<std::int32_t>::min() && intpart <= std::numeric_limits<std::int32_t>::max());
}
}
return false;
}
/**
* Returns true if this value is a 32-bit unsigned integer.
*/
bool v8::Value::IsUint32() const
{
HandleScope scope(Isolate::GetCurrent());
MaybeLocal<Number> num = ToNumber();
if (!num.IsEmpty()) {
JSValueRef exception = nullptr;
FROMTHIS(c,v);
double number = JSValueToNumber(c->m_ctxRef, v, &exception);
double intpart;
if (v == ToIsolateImpl(c)->m_negative_zero) return false;
if (std::modf(number, &intpart) == 0.0) {
return (intpart >= 0 && intpart <= std::numeric_limits<std::uint32_t>::max());
}
}
return false;
}
/**
* Returns true if this value is a Date.
*/
bool v8::Value::IsDate() const { FROMTHIS(c,v); return JSValueIsDate(c->m_ctxRef, v); }
/**
* Returns true if this value is an Arguments object.
*/
IS(IsArgumentsObject, "return Object.prototype.toString.call( _1 ) === '[object Arguments]';")
/**
* Returns true if this value is a Boolean object.
*/
IS(IsBooleanObject, "return (typeof _1 === 'object' && _1 !== null && typeof _1.valueOf() === 'boolean');")
/**
* Returns true if this value is a Number object.
*/
IS(IsNumberObject, "return (typeof _1 === 'object' && _1 !== null && typeof _1.valueOf() === 'number');")
/**
* Returns true if this value is a String object.
*/
IS(IsStringObject, "return (typeof _1 === 'object' && _1 !== null && typeof _1.valueOf() === 'string');")
/**
* Returns true if this value is a Symbol object.
*/
IS(IsSymbolObject, "return (typeof _1 === 'object' && _1 !== null && typeof _1.valueOf() === 'symbol');")
/**
* Returns true if this value is a NativeError.
*/
IS(IsNativeError, "return _1 instanceof Error")
/**
* Returns true if this value is a RegExp.
*/
IS(IsRegExp, "return Object.prototype.toString.call( _1 ) === '[object RegExp]';")
/**
* Returns true if this value is an async function.
*/
IS(IsAsyncFunction, "return _1 && _1.constructor && _1.constructor.name === 'AsyncFunction';")
/**
* Returns true if this value is a Generator function.
*/
IS(IsGeneratorFunction, "var Generator = (function*(){}).constructor; return _1 instanceof Generator")
/**
* Returns true if this value is a Generator object (iterator).
*/
IS(IsGeneratorObject, "return _1 && typeof _1[Symbol.iterator] === 'function'")
/**
* Returns true if this value is a Promise.
*/
IS(IsPromise, "return _1 && Promise && Promise.resolve && Promise.resolve(_1) == _1")
/**
* Returns true if this value is a Map.
*/
IS(IsMap, "return _1 instanceof Map")
/**
* Returns true if this value is a Set.
*/
IS(IsSet, "return _1 instanceof Set")
/**
* Returns true if this value is a Map Iterator.
*/
bool v8::Value::IsMapIterator() const { return false; } // FIXME
/**
* Returns true if this value is a Set Iterator.
*/
bool v8::Value::IsSetIterator() const { return false; } // FIXME
/**
* Returns true if this value is a WeakMap.
*/
IS(IsWeakMap, "return _1 instanceof WeakMap")
/**
* Returns true if this value is a WeakSet.
*/
IS(IsWeakSet, "return _1 instanceof WeakSet")
/**
* Returns true if this value is an ArrayBuffer.
*/
IS(IsArrayBuffer, "return _1 instanceof ArrayBuffer")
/**
* Returns true if this value is an ArrayBufferView.
*/
IS(IsArrayBufferView, "return _1 && _1.buffer instanceof ArrayBuffer && _1.byteLength !== undefined")
/**
* Returns true if this value is one of TypedArrays.
*/
IS(IsTypedArray, "return _1 && ArrayBuffer.isView(_1) && Object.prototype.toString.call(_1) !== '[object DataView]'")
/**
* Returns true if this value is an Uint8Array.
*/
IS(IsUint8Array, "return _1 instanceof Uint8Array")
/**
* Returns true if this value is an Uint8ClampedArray.
*/
IS(IsUint8ClampedArray, "return _1 instanceof Uint8ClampedArray")
/**
* Returns true if this value is an Int8Array.
*/
IS(IsInt8Array, "return _1 instanceof Int8Array")
/**
* Returns true if this value is an Uint16Array.
*/
IS(IsUint16Array, "return _1 instanceof Uint16Array")
/**
* Returns true if this value is an Int16Array.
*/
IS(IsInt16Array, "return _1 instanceof Int16Array")
/**
* Returns true if this value is an Uint32Array.
*/
IS(IsUint32Array, "return _1 instanceof Uint32Array")
/**
* Returns true if this value is an Int32Array.
*/
IS(IsInt32Array, "return _1 instanceof Int32Array")
/**
* Returns true if this value is a Float32Array.
*/
IS(IsFloat32Array, "return _1 instanceof Float32Array")
/**
* Returns true if this value is a Float64Array.
*/
IS(IsFloat64Array, "return _1 instanceof Float64Array")
/**
* Returns true if this value is a DataView.
*/
IS(IsDataView, "return _1 && Object.prototype.toString.call(_1) === '[object DataView]'")
/**
* Returns true if this value is a SharedArrayBuffer.
* This is an experimental feature.
*/
bool v8::Value::IsSharedArrayBuffer() const { return false; } // FIXME
/**
* Returns true if this value is a JavaScript Proxy.
*/
bool v8::Value::IsProxy() const
{
Isolate *isolate = ToIsolate(this);
HandleScope scope(isolate);
Local<v8::Context> context = ToCurrentContext(this);
JSContextRef ctx = ToContextRef(context);
JSValueRef maybe_proxy = ToJSValueRef(this, context);
return (JSValueIsObject(ctx, maybe_proxy) && JSObjectGetProxyTarget((JSObjectRef)maybe_proxy) != 0);
}
bool v8::Value::IsWebAssemblyCompiledModule() const { return false; } // FIXME
template <typename T, typename F>
Maybe<T> handleException(IsolateImpl* isolate, F&& lambda)
{
LocalException exception(isolate);
T value = lambda(&exception);
if (!exception.ShouldThrow()) {
return _maybe<T>(value).toMaybe();
}
return v8::Nothing<T>();
}
template <typename T>
Maybe<T> toValue(const v8::Value* thiz, Local<v8::Context> context, bool isNaNZero=false)
{
auto ctx = ToContextImpl(context);
JSValueRef value = ToJSValueRef<v8::Value>(thiz, context);
IsolateImpl* i = ToIsolateImpl(ctx);
LocalException exception(i);
T ret;
if (std::is_same<T,bool>::value) {
ret = JSValueToBoolean(ctx->m_ctxRef, value);
} else {
double number = JSValueToNumber(ctx->m_ctxRef, value, &exception);
if (isNaNZero && std::isnan(number)) number = 0;
ret = static_cast<T>(number);
}
if (!exception.ShouldThrow()) {
return _maybe<T>(ret).toMaybe();
}
return v8::Nothing<T>();
}
Maybe<bool> v8::Value::BooleanValue(Local<v8::Context> context) const { return toValue<bool>(this, context); }
Maybe<double> v8::Value::NumberValue(Local<v8::Context> context) const { return toValue<double>(this, context); }
Maybe<int64_t> v8::Value::IntegerValue(Local<v8::Context> context) const { return toValue<int64_t>(this, context, true); }
Maybe<uint32_t> v8::Value::Uint32Value(Local<v8::Context> context) const { return toValue<uint32_t>(this, context, true); }
Maybe<int32_t> v8::Value::Int32Value(Local<v8::Context> context) const { return toValue<int32_t>(this, context, true); }
Maybe<bool> v8::Value::Equals(Local<v8::Context> context, Local<v8::Value> that) const
{
JSValueRef this_ = ToJSValueRef<v8::Value>(this, context);
JSValueRef that_ = ToJSValueRef<v8::Value>(that, context);
JSContextRef context_ = ToContextRef(context);
IsolateImpl* i = ToIsolateImpl(ToContextImpl(context));
LocalException exception(i);
bool is = JSValueIsEqual(context_, this_, that_, &exception);
if (!exception.ShouldThrow()) {
return _maybe<bool>(is).toMaybe();
}
return Nothing<bool>();
}
bool v8::Value::StrictEquals(Local<v8::Value> that) const
{
HandleScope scope(Isolate::GetCurrent());
Local<v8::Context> context = ToCurrentContext(this);
JSValueRef this_ = ToJSValueRef(this, context);
JSValueRef that_ = ToJSValueRef(that, context);
return JSValueIsStrictEqual(ToContextRef(context), this_, that_);
}
bool v8::Value::SameValue(Local<v8::Value> that) const
{
HandleScope scope(Isolate::GetCurrent());
Local<v8::Context> context = ToCurrentContext(this);
JSValueRef this_ = ToJSValueRef(this, context);
JSValueRef that_ = ToJSValueRef(that, context);
IsolateImpl* iso = ToIsolateImpl(ToContextImpl(context));
if (this_ == that_) return true;
if (this_ == iso->m_negative_zero || that_ == iso->m_negative_zero) {
return false;
}
return JSValueIsStrictEqual(ToContextRef(context), this_, that_);
}
Local<v8::String> v8::Value::TypeOf(Isolate* isolate)
{
FROMTHIS(c,v);
JSValueRef exception = nullptr;
JSValueRef to = exec(c->m_ctxRef, "return typeof _1", 1, &v);
return V82JSC::String::New(isolate, JSValueToStringCopy(c->m_ctxRef, to, &exception));
}
Maybe<bool> v8::Value::InstanceOf(Local<v8::Context> context, Local<Object> object)
{
FROMTHIS(c,v);
JSValueRef args[] = {
v,
ToJSValueRef(object, context)
};
LocalException exception(ToIsolateImpl(ToContextImpl(context)));
JSValueRef is = exec(c->m_ctxRef, "return _1 instanceof _2", 2, args, &exception);
if (exception.ShouldThrow()) {
return Nothing<bool>();
}
return _maybe<bool>(JSValueToBoolean(c->m_ctxRef, is)).toMaybe();
}
MaybeLocal<v8::Uint32> v8::Value::ToArrayIndex(Local<v8::Context> context) const
{
HandleScope scope(Isolate::GetCurrent());
MaybeLocal<Number> num = ToNumber(context);
if (!num.IsEmpty() && num.ToLocalChecked()->IsUint32()) {
return ToUint32(context);
}
return MaybeLocal<Uint32>();
}
MaybeLocal<v8::Boolean> v8::Value::ToBoolean(Local<v8::Context> context) const
{
auto ctx = ToContextImpl(context);
JSValueRef v = ToJSValueRef(this, context);
return V82JSC::Value::New(ctx, JSValueMakeBoolean(ctx->m_ctxRef,
JSValueToBoolean(ctx->m_ctxRef, v))).As<v8::Boolean>();
}
MaybeLocal<v8::String> v8::Value::ToString(Local<v8::Context> context) const
{
auto ctx = ToContextImpl(context);
IsolateImpl* iso = ToIsolateImpl(ToContextImpl(context));
EscapableHandleScope scope(ToIsolate(iso));
JSValueRef v = ToJSValueRef(this, context);
LocalException exception(iso);
JSStringRef s = JSValueToStringCopy (ctx->m_ctxRef, v, &exception);
if (exception.ShouldThrow()) {
return MaybeLocal<String>();
}
return scope.Escape(V82JSC::String::New(reinterpret_cast<Isolate*>(iso), s));
}
MaybeLocal<v8::String> v8::Value::ToDetailString(Local<v8::Context> context) const { return ToString(context); } // FIXME
MaybeLocal<v8::Object> v8::Value::ToObject(Local<v8::Context> context) const
{
auto ctx = ToContextImpl(context);
IsolateImpl* iso = ToIsolateImpl(ToContextImpl(context));
EscapableHandleScope scope(ToIsolate(iso));
JSValueRef v = ToJSValueRef(this, context);
LocalException exception(iso);
JSObjectRef o = JSValueToObject(ctx->m_ctxRef, v, &exception);
if (exception.ShouldThrow()) {
return MaybeLocal<Object>();
}
return scope.Escape(V82JSC::Value::New(ctx, o).As<Object>());
}
template<class T, typename C>
MaybeLocal<T> ToNum(const v8::Value* thiz, Local<v8::Context> context)
{
auto ctx = ToContextImpl(context);
IsolateImpl* iso = ToIsolateImpl(ToContextImpl(context));
JSValueRef v = ToJSValueRef(thiz, context);
LocalException exception(iso);
double num = JSValueToNumber(ctx->m_ctxRef, v, &exception);
if (exception.ShouldThrow()) {
return MaybeLocal<T>();
}
C val;
if (std::is_same<C, double>::value ) {
val = num;
} else {
int64_t ival = static_cast<int64_t>(num);
uint32_t uval = ival & 0xffffffff;
val = *reinterpret_cast<C*>(&uval);
}
Local<v8::Number> nval = v8::Number::New(reinterpret_cast<Isolate*>(iso), val);
return nval.As<T>();
}
MaybeLocal<v8::Number> v8::Value::ToNumber(Local<v8::Context> context) const
{
return ToNum<Number, double>(this, context);
}
MaybeLocal<v8::Integer> v8::Value::ToInteger(Local<v8::Context> context) const
{
return ToNum<Integer, int32_t>(this, context);
}
MaybeLocal<v8::Uint32> v8::Value::ToUint32(Local<v8::Context> context) const
{
return ToNum<v8::Uint32, uint32_t>(this, context);
}
MaybeLocal<v8::Int32> v8::Value::ToInt32(Local<v8::Context> context) const
{
return ToNum<Int32, int32_t>(this, context);
}
JSClassRef s_externalClass = nullptr;
Local<v8::External> v8::External::New(Isolate* isolate, void* value)
{
EscapableHandleScope scope(isolate);
if (!s_externalClass) {
JSClassDefinition definition = kJSClassDefinitionEmpty;
definition.attributes |= kJSClassAttributeNoAutomaticPrototype;
definition.className = "External";
s_externalClass = JSClassCreate(&definition);
}
Local<v8::Context> context = ToIsolateImpl(isolate)->m_nullContext.Get(isolate);
JSObjectRef external = JSObjectMake(ToContextRef(context), s_externalClass, value);
auto e = V82JSC::Value::New(ToContextImpl(context), external);
return scope.Escape(e.As<External>());
}
void* v8::External::Value() const
{
auto context = ToCurrentContext(this);
auto v = ToJSValueRef<External>(this, context);
return JSObjectGetPrivate((JSObjectRef)v);
}
| [
"eric@flicket.tv"
] | eric@flicket.tv |
a1acbf171a418734796564a9a0a4f5029b92e360 | b80feaa86e9a5191376fb9a9270e59fcbcfe74dd | /test_photon_console/external_lib/Photon-MacOSX/Chat-cpp/inc/Listener.h | 8983777ff339da08b4c3baca83d8f30344db310d | [] | no_license | MissionToEarth/multi_play | 6b2bc8eee6b914761c4d6e1d655cb9a868e2c727 | 5979cc6ad74b769fbe57a22f1b5a46f25793020f | refs/heads/master | 2020-04-29T01:01:17.864308 | 2019-03-27T00:29:15 | 2019-03-27T00:29:15 | 175,716,132 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,568 | h | /* Exit Games Photon Chat - C++ Client Lib
* Copyright (C) 2004-2018 by Exit Games GmbH. All rights reserved.
* http://www.photonengine.com
* mailto:developer@photonengine.com
*/
#pragma once
#include "Photon-cpp/inc/PhotonPeer.h"
namespace ExitGames
{
namespace Chat
{
/**
Callback interface for Chat client side. Contains callback methods to notify your app about updates.
Must be provided to new Chat::Client in constructor*/
class Listener: public virtual Common::BaseListener
{
public:
virtual ~Listener(void){}
// receive and print out debug out here
virtual void debugReturn(int debugLevel, const Common::JString& string) = 0;
/**
Notifies app that client state changed.
@param state new client state
@sa ClientState::ClientState*/
virtual void onStateChange(int state) = 0;
// implement your error-handling here
virtual void connectionErrorReturn(int errorCode) = 0;
virtual void clientErrorReturn(int errorCode) = 0;
virtual void warningReturn(int warningCode) = 0;
virtual void serverErrorReturn(int errorCode) = 0;
// callbacks for operations on server
/**
Client is connected now.*/
virtual void connectReturn(int errorCode, const Common::JString& errorString) = 0;
/**
Disconnection happened.*/
virtual void disconnectReturn(void) = 0;
/**
The result of the subscribe operation. Returns per channel name if the channel is now subscribed.
@param channels channel names
@param results per channel result: true if subscribed*/
virtual void subscribeReturn(const Common::JVector<Common::JString>& channels, const Common::JVector<bool>& results) = 0;
/**
Result of unsubscribe operation. Returns per channel name if the channel is now subscribed.
@param channels channel names that are no longer subscribed*/
virtual void unsubscribeReturn(const Common::JVector<Common::JString>& channels) = 0;
/**
The new status of another user (you get updates for users that are in your friends list).
@param user name of the user
@param status new status of that user
@param gotMessage true if the status contains a message you should cache locally. False: This status update does not include a message (keep any you have).
@param message message that user set*/
virtual void onStatusUpdate(const Common::JString& user, int status, bool gotMessage, const Common::Object& message) = 0;
/**
Notifies the app that the client got new messages from the server
Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with
number '0', sender with number '1' corresponds to message with number '1' and so on
@param channelName channel from where messages came
@param senders list of users who sent messages
@param messages list of messages it self*/
virtual void onGetMessages(const Common::JString& channelName, const Common::JVector<Common::JString>& senders, const Common::JVector<Common::Object>& messages) = 0;
/**
Notifies the app about a private message
@param sender user who sent this message
@param message the message itself
@param channelName the channel name for private messages (messages that you sent yourself get added to a channel per target username)*/
virtual void onPrivateMessage(const Common::JString& sender, const Common::Object& message, const Common::JString& channelName) = 0;
};
/** @file */
}
} | [
"harada@platinum-egg.com"
] | harada@platinum-egg.com |
d4d1d0475d9abd94034055982d44b57415b17242 | 5f2da0e1a415b3dab841edeb2a7904fea547a14a | /include/Red/Text/Rendering/FreeType/FontFace.h | b9f8ba673dfe350be4ab6e5924029b521bf912a6 | [
"MIT"
] | permissive | OutOfTheVoid/ProjectRed | da608fa17208a710916565afa782016f15cfad64 | 801327283f5a302be130c90d593b39957c84cce5 | refs/heads/master | 2020-05-21T19:52:38.807725 | 2017-06-24T07:21:11 | 2017-06-24T07:21:11 | 63,619,563 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,649 | h | #ifndef RED_TEXT_RENDERING_FREETYPE_FONTFACE_H
#define RED_TEXT_RENDERING_FREETYPE_FONTFACE_H
#include <Red/Text/Rendering/FreeType/FreeType.h>
#ifdef RED_OPT_TEXT_RENDERING_FREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
#include <Red/Text/Rendering/IFontReference.h>
#include <Red/Util/RefCounted.h>
#include <Red/Util/RCMem.h>
#include <string>
namespace Red
{
namespace Text
{
namespace Rendering
{
namespace FreeType
{
class FreeTypeFontRenderData;
class FontFace : public Util :: RefCounted, public virtual IFontReference
{
public:
typedef uint32_t StyleFlag;
typedef uint32_t FaceFlag;
typedef uint32_t LoadFlag;
typedef FT_Pixel_Mode PixelMode;
typedef FT_Render_Mode RenderMode;
static const StyleFlag kStyleFlag_Italic = FT_STYLE_FLAG_ITALIC;
static const StyleFlag kStyleFlag_Bold = FT_STYLE_FLAG_BOLD;
static const FaceFlag kFaceFlag_Scalable = FT_FACE_FLAG_SCALABLE;
static const FaceFlag kFaceFlag_FixedSizes = FT_FACE_FLAG_FIXED_SIZES;
static const FaceFlag kFaceFlag_FixedWidth = FT_FACE_FLAG_FIXED_WIDTH;
static const FaceFlag kFaceFlag_HorizontalMetrics = FT_FACE_FLAG_HORIZONTAL;
static const FaceFlag kFaceFlag_VerticalMetrics = FT_FACE_FLAG_VERTICAL;
static const FaceFlag kFaceFlag_Kerning = FT_FACE_FLAG_KERNING;
static const LoadFlag kLoadFlag_Defaults = FT_LOAD_DEFAULT;
static const LoadFlag kLoadFlag_NoScale = FT_LOAD_NO_SCALE;
static const LoadFlag kLoadFlag_NoHinting = FT_LOAD_NO_HINTING;
static const LoadFlag kLoadFlag_AvoidBitmaps = FT_LOAD_NO_BITMAP;
static const LoadFlag kLoadFlag_AutoHint = FT_LOAD_FORCE_AUTOHINT;
static const LoadFlag kLoadFlag_Pedantic = FT_LOAD_PEDANTIC;
static const LoadFlag kLoadFlag_NoRecursion = FT_LOAD_NO_RECURSE;
static const LoadFlag kLoadFlag_NoTransform = FT_LOAD_IGNORE_TRANSFORM;
static const LoadFlag kLoadFlag_FontUnits = FT_LOAD_LINEAR_DESIGN;
static const LoadFlag kLoadFlag_NoAutoHint = FT_LOAD_NO_AUTOHINT;
static const LoadFlag kLoadFlag_LoadColor = FT_LOAD_COLOR;
static const LoadFlag kLoadFlag_ComputeMetrics = FT_LOAD_COMPUTE_METRICS;
static const PixelMode kPixelMode_Monochrome = FT_PIXEL_MODE_MONO;
static const PixelMode kPixelMode_Gray = FT_PIXEL_MODE_GRAY;
static const PixelMode kPixelMode_BGRA = FT_PIXEL_MODE_BGRA;
static const RenderMode kRenderMode_Normal = FT_RENDER_MODE_NORMAL;
static const RenderMode kRenderMode_Mono = FT_RENDER_MODE_MONO;
typedef struct
{
uint32_t Rows;
uint32_t Width;
int32_t Pitch;
uint32_t GrayCount;
PixelMode PixMode;
} BitmapMetrics;
static FontFace * NewFromFile ( const std :: string & FileName, uint32_t FaceIndex, const std :: string & RefName );
static FontFace * NewFromMemory ( Util :: RCMem * FileMemory, uint32_t FileSize, uint32_t FaceIndex, const std :: string & RefName );
~FontFace ();
uint32_t GetNumFaces () const;
uint32_t GetFaceIndex () const;
FaceFlag GetFaceFlags () const;
StyleFlag GetStyleFlags () const;
uint32_t GetNumGlyphs () const;
const std :: string & GetFamilyName () const;
const std :: string & GetStyleName () const;
uint32_t GetFixedSizeCount () const;
double GetFixedNominalWidth ( int32_t Index ) const;
double GetFixedNominalHeight ( int32_t Index ) const;
void SetPixelSize ( uint32_t PixelSize );
uint32_t GetPixelSize () const;
void SetRenderMode ( RenderMode RMode );
uint32_t GlyphIndexFromChar ( char32_t Char ) const;
bool LoadGlyph ( uint32_t Index, LoadFlag Flags );
bool RenderGlyph ();
void * GetBitmapPointer () const;
void GetBitmapMetrics ( BitmapMetrics & Metrics ) const;
void SetTransform ( double A, double B, double C, double D, double TX, double TY );
void SetIdentityTransform ( double TX, double TY );
const std :: string & GetName () const;
private:
friend class FreeTypeFontRenderData;
FontFace ( const std :: string & RefName );
FT_Face FHandle;
bool Valid;
uint32_t PixelSize;
Util :: RCMem * MemFile;
std :: string FamilyName;
std :: string StyleName;
RenderMode RMode;
std :: string RefName;
uint32_t LastLoaded;
LoadFlag LastLoadFlags;
};
}
}
}
}
#endif
#endif
| [
"liam.tab@gmail.com"
] | liam.tab@gmail.com |
ba395f4e44a3f2fce0be45ab3e02a34d5056b513 | c74e77aed37c97ad459a876720e4e2848bb75d60 | /800-899/854/(30196484)[WRONG_ANSWER]B[ b'Maxim Buys an Apartment' ].cpp | 59e277c8a3faa370734f7ccd6dacaef21169bc18 | [] | no_license | yashar-sb-sb/my-codeforces-submissions | aebecf4e906a955f066db43cb97b478d218a720e | a044fccb2e2b2411a4fbd40c3788df2487c5e747 | refs/heads/master | 2021-01-21T21:06:06.327357 | 2017-11-14T21:20:28 | 2017-11-14T21:28:39 | 98,517,002 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 350 | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
typedef long double ldb;
typedef pair<int,int> pii;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
int n,k;
cin>>n>>k;
int ans = 0;
ans = n-k;
ans = min(ans, 2*k);
cout<<int(n!=k)<<' '<<ans<<endl;
return 0;
}
| [
"yashar_sb_sb@yahoo.com"
] | yashar_sb_sb@yahoo.com |
09b1897fe075b7f01ca1596e40e11b85fb586030 | 6b5ec0858833bc5878a81e4e4a284c0e936e0151 | /source/CPP/LearingCppWithMe/ppt&src01-25/10cpp/10cpp/10cpp/A.cpp | f3da2b92d7b5da247e4a000c030867132cbf55fd | [] | no_license | sinomiko/reading | c185b58aef9901666926e2fd8aef5becb6e97698 | 0a7159dfabcb207771672813119c5f56fcd849d4 | refs/heads/master | 2023-08-16T21:10:39.547361 | 2023-08-11T03:20:06 | 2023-08-11T03:20:06 | 79,688,398 | 1 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 48 | cpp | #include "A.h"
A::A(void)
{
}
A::~A(void)
{
}
| [
"xiaoming.song@ericsson.com"
] | xiaoming.song@ericsson.com |
b2db694ca6a4773f8d8536e1b40adf2b37084bea | 7f7ebd4118d60a08e4988f95a846d6f1c5fd8eda | /wxWidgets-2.9.1/include/wx/motif/choice.h | 8379a03cf9cd63ab205031bceea51ef0f377dfd3 | [] | no_license | esrrhs/fuck-music-player | 58656fc49d5d3ea6c34459630c42072bceac9570 | 97f5c541a8295644837ad864f4f47419fce91e5d | refs/heads/master | 2021-05-16T02:34:59.827709 | 2021-05-10T09:48:22 | 2021-05-10T09:48:22 | 39,882,495 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,044 | h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/motif/choice.h
// Purpose: wxChoice class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICE_H_
#define _WX_CHOICE_H_
#include "wx/clntdata.h"
#ifndef wxWIDGET_ARRAY_DEFINED
#define wxWIDGET_ARRAY_DEFINED
#include "wx/dynarray.h"
WX_DEFINE_ARRAY_PTR(WXWidget, wxWidgetArray);
#endif
// Choice item
class WXDLLIMPEXP_CORE wxChoice: public wxChoiceBase
{
DECLARE_DYNAMIC_CLASS(wxChoice)
public:
wxChoice();
virtual ~wxChoice();
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Init();
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr)
{
Init();
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
// implementation of wxControlWithItems
virtual unsigned int GetCount() const;
virtual int GetSelection() const;
virtual void DoDeleteOneItem(unsigned int n);
virtual void DoClear();
virtual void SetString(unsigned int n, const wxString& s);
virtual wxString GetString(unsigned int n) const;
// implementation of wxChoiceBase
virtual void SetSelection(int n);
virtual void SetColumns(int n = 1 );
virtual int GetColumns() const ;
// Original API
virtual void Command(wxCommandEvent& event);
void SetFocus();
// Implementation
virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const { return m_formWidget; }
WXWidget GetMainWidget() const { return m_buttonWidget; }
virtual wxSize DoGetBestSize() const;
// implementation, for wxChoiceCallback
const wxWidgetArray& GetWidgets() const { return m_widgetArray; }
const wxArrayString& GetStrings() const { return m_stringArray; }
protected:
// minimum size for the text ctrl
wxSize GetItemsSize() const;
// common part of all contructors
void Init();
WXWidget m_menuWidget;
WXWidget m_buttonWidget;
wxWidgetArray m_widgetArray;
WXWidget m_formWidget;
wxArrayString m_stringArray;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
// implementation of wxControlWithItems
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type);
};
#endif // _WX_CHOICE_H_
| [
"esrrhs@esrrhs-PC"
] | esrrhs@esrrhs-PC |
6455c6c522d3fdd21e006cf9b66f75e6fe6f8c65 | df8eb78052f2b28d5fe85c6243fbc7e451e715ca | /State.hpp | 5074d4a08f4037175e55081ea1f1520a786e7385 | [
"MIT"
] | permissive | KraevRoot/tik-tak-toe | 0e376cc000493282d49dc38b44ee6f27923bf67d | 5d8c65fb49f2a7090559a12a3fce2270c134631c | refs/heads/master | 2021-01-11T02:41:20.533062 | 2018-04-08T13:35:08 | 2018-04-08T13:35:08 | 70,947,498 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 302 | hpp | #pragma once
namespace TicTacToe
{
class State
{
public:
virtual void Init() = 0;
virtual void HandleInput() = 0;
virtual void Update(float dt) = 0;
virtual void Draw(float dt) = 0;
virtual void Pause() {}
virtual void Resume() {}
};
}
| [
"kraevroot@gmail.com"
] | kraevroot@gmail.com |
bc3b6cc5f76d989af28b613ed23347327d6b7a4a | e5e5e43423485340a25361420ed3bc8d2cfaa5d0 | /question_7/q7.cpp | 0adc48a506b36905e354faf10712402e572bfa7a | [] | no_license | PPL-IIITA/ppl-assignment-pt97 | 39d216e8a10eaf709b384d78d0360a44624f5a22 | 7015713e751aad193e8c7354b162b7e1cd2b2000 | refs/heads/master | 2021-01-21T06:21:27.247313 | 2017-04-09T20:46:51 | 2017-04-09T20:46:51 | 83,219,125 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 174 | cpp | #include "boysgirl.h"
#include "jodi.h"
#include <bits/stdc++.h>
using namespace std;
int main()
{
make2();
return 0;
}
//to run this file g++ q7.cpp jodi.cpp boysgirl.cpp | [
"iit2015094@iiita.ac.in"
] | iit2015094@iiita.ac.in |
0dea5b2c470683935388f3c41e708a528d6c8dd5 | e60678d3bd87ba051f73772fe956271847bd09d5 | /18-c-and-cpp/cpp_project/cpp_projects_weids/cpp_projects/09th_operator/person.cpp | 343daee059c271640f88791ae50e9878787abb02 | [] | no_license | juyingguo/android-knowledge-principle-interview | da75682d97ab9353850567eb9d96f516a7d36328 | 368a3ce91bc9bd735d78985a8dd8925232f9b8c6 | refs/heads/master | 2023-04-15T06:18:36.200436 | 2023-03-21T13:39:29 | 2023-03-21T13:39:29 | 198,389,681 | 2 | 2 | null | 2022-09-01T23:10:43 | 2019-07-23T08:44:37 | Java | GB18030 | C++ | false | false | 2,300 | cpp |
#include <iostream>
#include <string.h>
#include <unistd.h>
using namespace std;
class Person {
private:
static int cnt;
char *name;
int age;
char *work;
public:
static int getCount(void);
Person() {//cout <<"Pserson()"<<endl;
name = NULL;
work = NULL;
cnt++;
}
Person(char *name)
{
//cout <<"Pserson(char *)"<<endl;
this->name = new char[strlen(name) + 1];
strcpy(this->name, name);
this->work = NULL;
cnt++;
}
Person(char *name, int age, char *work = "none")
{
cout <<"Pserson(char*, int), name = "<<name<<", age= "<<age<<endl;
this->age = age;
this->name = new char[strlen(name) + 1];
strcpy(this->name, name);
this->work = new char[strlen(work) + 1];
strcpy(this->work, work);
cnt++;
}
Person(const Person &per)
{
cout <<"Pserson(Person &)"<<endl;
this->age = per.age;
this->name = new char[strlen(per.name) + 1];
strcpy(this->name, per.name);
this->work = new char[strlen(per.work) + 1];
strcpy(this->work, per.work);
cnt++;
}
~Person()
{
cout << "~Person()"<<endl;
if (this->name) {
cout << "name = "<<name<<endl;
delete this->name;
}
if (this->work) {
cout << "work = "<<work<<endl;
delete this->work;
}
}
void setName(char *n)
{
name = n;
}
int setAge(int a)
{
if (a < 0 || a > 150)
{
age = 0;
return -1;
}
age = a;
return 0;
}
void printInfo(void) const
{
//printf("name = %s, age = %d, work = %s\n", name, age, work);
cout<<"name = "<<name<<", age = "<<age<<", work = "<<work<<endl;
}
Person& operator=(const Person& p)
{
cout << "operator=(const Person& p)"<<endl;
if (this == &p)
return *this;
this->age = p.age;
if (this->name) {
delete this->name;
}
if (this->work) {
delete this->work;
}
this->name = new char[strlen(p.name) + 1];
strcpy(this->name, p.name);
this->work = new char[strlen(p.work) + 1];
strcpy(this->work, p.work);
return *this;
}
};
int Person::cnt = 0; /* 定义和初始化 */
int Person::getCount(void)
{
return cnt;
}
int main(int argc, char **argv)
{
const Person p1("zhangsan", 10);
cout<<"Person p2 = p1" <<endl;
Person p2 = p1;
Person p3;
cout<<"p3=p1"<<endl;
p3 = p1;
cout<<"end"<<endl;
p1.printInfo();
p2.printInfo();
p3.printInfo();
return 0;
}
| [
"juying2050@sina.cn"
] | juying2050@sina.cn |
36e8b00524a4c257be8c081c62f4f6f1d7d595ee | e41db940987faa23cd6f63b8e9d250fd8a86efce | /arduino/ircontrol/ircontrol.ino | 9b484ed03b6c4aecd47e22da5f5bbc7687b105c4 | [] | no_license | saadismail/dldproject | 81789a075d9bbdb7fe2a4753ea621507eab65c4e | 54784c24fe447e4954c7357ce140d5b1b580ace2 | refs/heads/master | 2021-01-22T07:52:52.805018 | 2017-05-27T08:34:54 | 2017-05-27T08:34:54 | 92,584,174 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,441 | ino | #include "IRremote.h"
int receiver = 5; // Signal Pin of IR receiver to Arduino Digital Pin 11
unsigned long last = millis();
char data = 0; //Variable for storing received data
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results; // create instance of 'decode_results'
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
pinMode(12, OUTPUT); //Sets digital pin 13 as output pin
pinMode(8, OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
if (millis() - last > 250) {
translateIR();
}
last = millis();
irrecv.resume(); // Receive the next value
}
if (Serial.available() > 0) {
translateBT();
}
}
void translateIR() {
switch(results.value) {
case 0xFF6897: digitalWrite(8, LOW); break;
case 0xFF30CF: digitalWrite(8, HIGH); break;
case 0xFF18E7: digitalWrite(12, LOW); break;
case 0xFF7A85: digitalWrite(12, HIGH); break;
}
}
void translateBT() {
data = Serial.read();
if(data == '0') //Checks whether value of data is equal to 1
digitalWrite(8, LOW); //If value is 1 then LED turns ON
else if(data == '1') //Checks whether value of data is equal to 0
digitalWrite(8, HIGH); //If value is 0 then LED turns OFF
else if (data == '2')
digitalWrite(12, LOW);
else if (data == '3')
digitalWrite(12, HIGH);
}
| [
"saad3112@gmail.com"
] | saad3112@gmail.com |
a72b1507a70ee1e4992c39e624999247d0d03d94 | 49b878b65e9eb00232490243ccb9aea9760a4a6d | /chrome/browser/webshare/share_service_impl.cc | bf2a4ff218ab102c566f98291b12074bbc356f50 | [
"BSD-3-Clause"
] | permissive | romanzes/chromium | 5a46f234a233b3e113891a5d643a79667eaf2ffb | 12893215d9efc3b0b4d427fc60f5369c6bf6b938 | refs/heads/master | 2022-12-28T00:20:03.524839 | 2020-10-08T21:01:52 | 2020-10-08T21:01:52 | 302,470,347 | 0 | 0 | BSD-3-Clause | 2020-10-08T22:10:22 | 2020-10-08T21:54:38 | null | UTF-8 | C++ | false | false | 5,632 | cc | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/webshare/share_service_impl.h"
#include <algorithm>
#include "base/feature_list.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "chrome/common/chrome_features.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
// IsDangerousFilename() and IsDangerousMimeType() should be kept in sync with
// //third_party/blink/renderer/modules/webshare/FILE_TYPES.md
// //components/browser_ui/webshare/android/java/src/org/chromium/components/browser_ui/webshare/ShareServiceImpl.java
ShareServiceImpl::ShareServiceImpl(content::RenderFrameHost& render_frame_host)
: content::WebContentsObserver(
content::WebContents::FromRenderFrameHost(&render_frame_host)),
#if defined(OS_CHROMEOS)
sharesheet_client_(web_contents()),
#endif
render_frame_host_(&render_frame_host) {
DCHECK(base::FeatureList::IsEnabled(features::kWebShare));
}
ShareServiceImpl::~ShareServiceImpl() = default;
// static
void ShareServiceImpl::Create(
content::RenderFrameHost* render_frame_host,
mojo::PendingReceiver<blink::mojom::ShareService> receiver) {
mojo::MakeSelfOwnedReceiver(
std::make_unique<ShareServiceImpl>(*render_frame_host),
std::move(receiver));
}
// static
bool ShareServiceImpl::IsDangerousFilename(base::StringPiece name) {
constexpr std::array<const char*, 39> kPermitted = {
".bmp", // image/bmp / image/x-ms-bmp
".css", // text/css
".csv", // text/csv / text/comma-separated-values
".ehtml", // text/html
".flac", // audio/flac
".gif", // image/gif
".htm", // text/html
".html", // text/html
".ico", // image/x-icon
".jfif", // image/jpeg
".jpeg", // image/jpeg
".jpg", // image/jpeg
".m4a", // audio/x-m4a
".m4v", // video/mp4
".mp3", // audio/mp3
".mp4", // video/mp4
".mpeg", // video/mpeg
".mpg", // video/mpeg
".oga", // audio/ogg
".ogg", // audio/ogg
".ogm", // video/ogg
".ogv", // video/ogg
".opus", // audio/ogg
".pjp", // image/jpeg
".pjpeg", // image/jpeg
".png", // image/png
".shtm", // text/html
".shtml", // text/html
".svg", // image/svg+xml
".svgz", // image/svg+xml
".text", // text/plain
".tif", // image/tiff
".tiff", // image/tiff
".txt", // text/plain
".wav", // audio/wav
".weba", // audio/webm
".webm", // video/webm
".webp", // image/webp
".xbm", // image/x-xbitmap
};
for (const char* permitted : kPermitted) {
if (base::EndsWith(name, permitted, base::CompareCase::INSENSITIVE_ASCII))
return false;
}
return true;
}
// static
bool ShareServiceImpl::IsDangerousMimeType(base::StringPiece content_type) {
constexpr std::array<const char*, 25> kPermitted = {
"audio/flac",
"audio/mp3",
"audio/ogg",
"audio/wav",
"audio/webm",
"audio/x-m4a",
"image/bmp",
"image/gif",
"image/jpeg",
"image/png",
"image/svg+xml",
"image/tiff",
"image/webp",
"image/x-icon",
"image/x-ms-bmp",
"image/x-xbitmap",
"text/comma-separated-values",
"text/css",
"text/csv",
"text/html",
"text/plain",
"video/mp4",
"video/mpeg",
"video/ogg",
"video/webm",
};
for (const char* permitted : kPermitted) {
if (content_type == permitted)
return false;
}
return true;
}
void ShareServiceImpl::Share(const std::string& title,
const std::string& text,
const GURL& share_url,
std::vector<blink::mojom::SharedFilePtr> files,
ShareCallback callback) {
content::WebContents* const web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host_);
if (!web_contents) {
std::move(callback).Run(blink::mojom::ShareError::PERMISSION_DENIED);
return;
}
if (files.size() > kMaxSharedFileCount) {
std::move(callback).Run(blink::mojom::ShareError::PERMISSION_DENIED);
return;
}
for (auto& file : files) {
if (!file || !file->blob || !file->blob->blob) {
mojo::ReportBadMessage("Invalid file to share()");
return;
}
if (IsDangerousFilename(file->name) ||
IsDangerousMimeType(file->blob->content_type)) {
std::move(callback).Run(blink::mojom::ShareError::PERMISSION_DENIED);
return;
}
// In the case where the original blob handle was to a native file (of
// unknown size), the serialized data does not contain an accurate file
// size. To handle this, the comparison against kMaxSharedFileBytes should
// be done by the platform-specific implementations as part of processing
// the blobs.
}
#if defined(OS_CHROMEOS)
sharesheet_client_.Share(title, text, share_url, std::move(files),
std::move(callback));
#else
// TODO(crbug.com/1035527): Add implementation for OS_WIN
NOTIMPLEMENTED();
std::move(callback).Run(blink::mojom::ShareError::OK);
#endif
}
void ShareServiceImpl::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
if (render_frame_host == render_frame_host_)
render_frame_host_ = nullptr;
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
8379a1de57893129359a309ae0861ce569cb79b2 | c27df8ce4903389256023f71fc8004c6caf41d21 | /inc/oxc_stepmotor_gpio.h | 0222f3910c9fc8cb486db659cb9b77cdb6b1baf3 | [] | no_license | atu-guda/stm32oxc | be8f584e6978fa40482bbd5df4a23bd6b41329eb | 591b43246b8928329642b06bad8b9de6802e62ed | refs/heads/master | 2023-09-03T08:42:36.058233 | 2023-09-02T19:15:15 | 2023-09-02T19:15:15 | 34,165,176 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 838 | h | #ifndef _OXC_STEPMOTOR_GPIO_H
#define _OXC_STEPMOTOR_GPIO_H
// stepmotor control via gpio
#include <oxc_gpio.h>
#include <oxc_stepmotor.h>
class StepMotorDriverGPIO : public StepMotorDriverBase {
public:
explicit StepMotorDriverGPIO( PinsOut &a_pins ) noexcept : pins( a_pins ) {}
virtual void set( uint16_t outs ) noexcept override { pins.write( outs ); };
virtual void init() noexcept override { pins.initHW(); };
protected:
PinsOut &pins;
};
class StepMotorDriverGPIO_e : public StepMotorDriverBase {
public:
explicit StepMotorDriverGPIO_e( GpioRegs &gi, uint8_t a_start, uint8_t a_n ) noexcept : pins( gi, a_start, a_n ) {}
virtual void set( uint16_t outs ) noexcept override { pins.write( outs ); };
virtual void init() noexcept override { pins.initHW(); };
protected:
PinsOut pins;
};
#endif
| [
"atu@nmetau.edu.ua"
] | atu@nmetau.edu.ua |
be92ee61bec863b7d0af632c5179398d637bdced | ad56ed0bcf5bb6c278d79a0090b30ea309d0fba0 | /Cache.h | 2b5dddc3f6bc3593e2280e35ff9c3ae8a900e4da | [
"MIT"
] | permissive | marabolic/FileSystem | 58ce365f2829fbec2edf82a65cfd608ad163b471 | acc0fc32fcc52e3197c5651ca3c852c54f89760c | refs/heads/master | 2023-02-13T13:59:29.563044 | 2021-01-18T10:39:17 | 2021-01-18T10:39:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 470 | h | #pragma once
#include "particija-VS2017/part.h"
class Cache
{
public:
Cache(Partition * name);
~Cache();
virtual ClusterNo getNumOfClusters() const; //vraca broj klastera koji pripadaju particiji
virtual int readCluster(ClusterNo, char* buffer); //cita zadati klaster i u slucaju uspeha vraca 1; u suprotnom 0
virtual int writeCluster(ClusterNo, const char* buffer); //upisuje zadati klaster i u slucaju uspeha vraca 1; u suprotnom 0
Partition* partition;
};
| [
"maki.bolic@gmail.com"
] | maki.bolic@gmail.com |
74e16b1fcf3dd78ca31fb3723c7462591996f30f | ed591c133a73faba33842f96a92e96d501aa33cc | /OS1/10_floating_operations/10 floating operations.cpp | dafc561129b842c7095e3981308b67867c7090bb | [] | no_license | lukassotornik/UPOL | 229a6a1b1d73fdc4efd51d03b411077bf302a95f | 610c63c821a988fcf154c9606726b31c0978149a | refs/heads/master | 2020-03-31T14:42:28.181196 | 2018-09-18T08:20:58 | 2018-09-18T08:20:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,596 | cpp | // 10 floating operations.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream"
using namespace std;
double obvod_obdelnika(double a, double b) {
_asm {
fld a
fld b
fadd st, st(1)
fadd st, st
}
}
double obsah_obdelnika(double a, double b) {
_asm {
fld a
fld b
fmul
}
}
double obvod_ctverce(double a) {
_asm {
push 4
fld a
fimul dword ptr [esp]
add esp, 4
}
}
double obsah_ctverce(double a) {
_asm {
fld a
fmul st, st
}
}
double obvod_kruhu(double r) {
_asm {
fldpi
fld r
fmul
fadd st, st
}
}
double obsah_kruhu(double d) {
_asm {
push 2
fld d
fidiv dword ptr [esp]
add esp, 4
fmul st, st
fldpi
fmul
}
}
float avg(float a, float b, float c) {
_asm {
fld a
fld b
fadd
fld c
fadd
push 3
fdiv
add esp, 4
}
}
double heron(double a, double b, double c) {
double s;
_asm {
push 2
fld a
fld b
fadd
fld c
fadd
fidiv dword ptr [esp]
add esp, 4
fst s
fld a
fsub
fld s
fld b
fsub
fmul
fld s
fld c
fsub
fmul
fld s
fmul
fabs
fsqrt
}
}
int main()
{
cout << "obvod obdelnika: " << obvod_obdelnika(5.3, 2.5) << endl;
cout << "obsag obdelnika: " << obsah_obdelnika(5.3, 2.5) << endl;
cout << "obvod ctverce: " << obvod_ctverce(5.5) << endl;
cout << "obsah ctverce: " << obsah_ctverce(5.5) << endl;
cout << "obvod kruhu: " << obvod_kruhu(5) << endl;
cout << "obsah kruhu: " << obsah_kruhu(10) << endl;
cout << "avg: " << avg(1.5, 2.3, 4.8) << endl;
cout << "heron: " << heron(1, 1, 1) << endl;
return 0;
}
| [
"32402640+klnmi97@users.noreply.github.com"
] | 32402640+klnmi97@users.noreply.github.com |
3c4fde84f07bee2a0a61b6a934a7b952001c3b5f | c6389f9b11fd40ee9295f4e88a14a8057e294e4f | /components/asio/asio/asio/src/examples/cpp03/tutorial/daytime4/client.cpp | cb2e08cdabac0d87f78db73466dff42a34eba15f | [
"BSL-1.0",
"MIT"
] | permissive | ghsecuritylab/N14 | 987ebb27cfbd7ebf84deadeb09a480aa51be34c7 | 76bc595e3face0903436e48165f31724e4d4532a | refs/heads/master | 2021-02-28T19:46:09.834253 | 2019-11-19T14:36:58 | 2019-11-19T14:36:58 | 245,728,464 | 0 | 0 | MIT | 2020-03-08T00:40:31 | 2020-03-08T00:40:30 | null | UTF-8 | C++ | false | false | 1,217 | cpp | //
// client.cpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include <iostream>
#include <boost/array.hpp>
#include <asio.hpp>
using asio::ip::udp;
int main(int argc, char* argv[])
{
try
{
if (argc != 2)
{
std::cerr << "Usage: client <host>" << std::endl;
return 1;
}
asio::io_context io_context;
udp::resolver resolver(io_context);
udp::endpoint receiver_endpoint =
*resolver.resolve(udp::v4(), argv[1], "daytime").begin();
udp::socket socket(io_context);
socket.open(udp::v4());
boost::array<char, 1> send_buf = {{ 0 }};
socket.send_to(asio::buffer(send_buf), receiver_endpoint);
boost::array<char, 128> recv_buf;
udp::endpoint sender_endpoint;
size_t len = socket.receive_from(
asio::buffer(recv_buf), sender_endpoint);
std::cout.write(recv_buf.data(), len);
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
}
return 0;
}
| [
"qitas@qitas.cn"
] | qitas@qitas.cn |
27704876c5be4861b25df14e31e2fe41520d2336 | 657261b2230168ff07d340e9bf7627feda5054e6 | /const/main.cpp | e6ca8ec8d5a1284e5facc9e475bf763a2789ff6f | [] | no_license | canercandan/cxx-examples | dd0544eba80b30eedec899d68075f705b2dbc2ad | 5f3d517866d62e0061164b43cafa0b0c091ddcc5 | refs/heads/master | 2021-01-10T21:03:54.191037 | 2013-03-15T13:48:12 | 2013-03-15T13:48:12 | 1,288,958 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 881 | cpp | // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Caner Candan <caner@candan.fr>, http://caner.candan.fr
*/
int main(void)
{
int b = 2;
const int * const a = &b;
//*a = 0;
}
| [
"caner@candan.fr"
] | caner@candan.fr |
4bcb8fdb401a3d3c7b2b14006f65e087aaa72fa5 | 21dd37929268a60b1ebace94a8f1b5339a17018d | /src/GameServer/User.h | 5e4790554d6d74954b41a37a364e41fbb8725059 | [] | no_license | mendo13/koserver | c13cc0079fd1129627b00ca95654601df5c12b3b | 1c5a151f1558922b5c1a95b7323ca71c22158c72 | refs/heads/master | 2020-12-01T01:04:32.638815 | 2013-09-19T10:09:55 | 2013-09-19T10:09:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 40,588 | h | #pragma once
#include "LuaEngine.h"
#include "../shared/KOSocket.h"
#include "Unit.h"
#include "ChatHandler.h"
struct _KNIGHTS_USER;
struct _EXCHANGE_ITEM;
struct _USER_SEAL_ITEM;
typedef std::map<uint64, _USER_SEAL_ITEM*> UserItemSealMap;
typedef std::list<_EXCHANGE_ITEM*> ItemList;
typedef std::map<uint32, time_t> SkillCooldownList;
typedef std::map<uint16, time_t> RHitRepeatList;
typedef std::map<uint32, time_t> UserSavedMagicMap;
// Time (in seconds) between each save request (5 min).
#define PLAYER_SAVE_INTERVAL (5 * 60)
// Time (in seconds) between each skill request (-1 sec).
#define PLAYER_SKILL_REQUEST_INTERVAL 0.7f
// Time (in seconds) between each r hit request (-1 sec).
#define PLAYER_R_HIT_REQUEST_INTERVAL 1.0f
// Time (in minute) for daily operations
#define DAILY_OPERATIONS_MINUTE 1440
enum GameState
{
GAME_STATE_CONNECTED,
GAME_STATE_INGAME
};
enum MerchantState
{
MERCHANT_STATE_NONE = -1,
MERCHANT_STATE_SELLING = 0,
MERCHANT_STATE_BUYING = 1
};
enum ClassType
{
ClassWarrior = 1,
ClassRogue = 2,
ClassMage = 3,
ClassPriest = 4,
ClassWarriorNovice = 5,
ClassWarriorMaster = 6,
ClassRogueNovice = 7,
ClassRogueMaster = 8,
ClassMageNovice = 9,
ClassMageMaster = 10,
ClassPriestNovice = 11,
ClassPriestMaster = 12
};
enum WarpListResponse
{
WarpListGenericError = 0,
WarpListSuccess = 1, // "You've arrived at."
WarpListMinLevel = 2, // "You need to be at least level <level>."
WarpListNotDuringCSW = 3, // "You cannot enter during the Castle Siege War."
WarpListNotDuringWar = 4, // "You cannot enter during the Lunar War."
WarpListNeedNP = 5, // "You cannot enter when you have 0 national points."
WarpListWrongLevelDLW = 6, // "Only characters with level 30~50 can enter." (dialog)
WarpListDoNotQualify = 7, // "You can not enter because you do not qualify." (dialog)
WarpListRecentlyTraded = 8, // "You can't teleport for 2 minutes after trading." (dialog)
WarpListArenaFull = 9, // "Arena Server is full to capacity. Please try again later." (dialog)
WarpListFinished7KeysQuest = 10, // "You can't enter because you completed Guardian of 7 Keys quest." (dialog)
};
enum TransformationType
{
TransformationNone,
TransformationMonster,
TransformationNPC,
TransformationSiege
};
enum TeamColour
{
TeamColourNone = 0,
TeamColourBlue,
TeamColourRed
};
#define ARROW_EXPIRATION_TIME (5) // seconds
struct Arrow
{
uint32 nSkillID;
time_t tFlyingTime;
Arrow(uint32 nSkillID, time_t tFlyingTime)
{
this->nSkillID = nSkillID;
this->tFlyingTime = tFlyingTime;
}
};
typedef std::vector<Arrow> ArrowList;
#include "GameDefine.h"
class CGameServerDlg;
class CUser : public Unit, public KOSocket
{
public:
virtual uint16 GetID() { return GetSocketID(); }
std::string & GetAccountName() { return m_strAccountID; }
virtual std::string & GetName() { return m_strUserID; }
std::string m_strAccountID, m_strUserID;
uint8 m_bRace;
uint16 m_sClass;
uint32 m_nHair;
uint8 m_bRank;
uint8 m_bTitle;
int64 m_iExp;
uint32 m_iLoyalty, m_iLoyaltyMonthly;
uint32 m_iMannerPoint;
uint8 m_bFace;
uint8 m_bCity;
int16 m_bKnights;
uint8 m_bFame;
int16 m_sHp, m_sMp, m_sSp;
uint8 m_bStats[STAT_COUNT];
uint8 m_bAuthority;
int16 m_sPoints; // this is just to shut the compiler up
uint32 m_iGold, m_iBank;
int16 m_sBind;
uint8 m_bstrSkill[10];
_ITEM_DATA m_sItemArray[INVENTORY_TOTAL];
_ITEM_DATA m_sWarehouseArray[WAREHOUSE_MAX];
uint8 m_bLogout;
uint32 m_dwTime;
time_t m_lastSaveTime;
uint8 m_bAccountStatus;
uint8 m_bPremiumType;
uint16 m_sPremiumTime;
bool m_bSelectedCharacter;
bool m_bStoreOpen;
int8 m_bMerchantState;
int16 m_sMerchantsSocketID;
std::list<uint16> m_arMerchantLookers;
_MERCH_DATA m_arMerchantItems[MAX_MERCH_ITEMS]; //What is this person selling? Stored in "_MERCH_DATA" structure.
bool m_bPremiumMerchant;
UserItemSealMap m_sealedItemMap;
uint8 m_bRequestingChallenge, // opcode of challenge request being sent by challenger
m_bChallengeRequested; // opcode of challenge request received by challengee
int16 m_sChallengeUser;
// Rival system
int16 m_sRivalID; // rival's session ID
time_t m_tRivalExpiryTime; // time when the rivalry ends
// Anger gauge system
uint8 m_byAngerGauge; // values range from 0-5
// Magic System Cooldown checks
SkillCooldownList m_CoolDownList;
// Attack System Cooldown checks
RHitRepeatList m_RHitRepeatList;
ArrowList m_flyingArrows;
FastMutex m_arrowLock;
TransformationType m_transformationType;
uint16 m_sTransformID;
time_t m_tTransformationStartTime;
uint16 m_sTransformationDuration;
bool m_bIsChicken; // Is the character taking the beginner/chicken quest?
bool m_bIsHidingHelmet;
bool m_bMining;
time_t m_tLastMiningAttempt;
int8 m_bPersonalRank;
int8 m_bKnightsRank;
float m_oldx, m_oldy, m_oldz;
int16 m_sDirection;
int64 m_iMaxExp;
uint32 m_sMaxWeight;
uint16 m_sMaxWeightBonus;
uint16 m_sSpeed; // NOTE: Currently unused
uint8 m_bPlayerAttackAmount;
uint8 m_bAddWeaponDamage;
uint16 m_sAddArmourAc;
uint8 m_bPctArmourAc;
int16 m_sItemMaxHp;
int16 m_sItemMaxMp;
uint32 m_sItemWeight;
short m_sItemAc;
short m_sItemHitrate;
short m_sItemEvasionrate;
uint8 m_byAPBonusAmount;
uint8 m_byAPClassBonusAmount[4]; // one for each of the 4 class types
uint8 m_byAcClassBonusAmount[4]; // one for each of the 4 class types
int16 m_sStatItemBonuses[STAT_COUNT];
int8 m_bStatBuffs[STAT_COUNT];
uint16 m_sExpGainAmount;
uint8 m_bItemExpGainAmount;
uint8 m_bNPGainAmount, m_bItemNPBonus, m_bSkillNPBonus;
uint8 m_bNoahGainAmount, m_bItemNoahGainAmount;
uint8 m_bMaxWeightAmount;
short m_iMaxHp, m_iMaxMp;
uint8 m_bResHpType;
bool m_bWarp;
uint8 m_bNeedParty;
uint16 m_sPartyIndex;
bool m_bInParty;
bool m_bPartyLeader;
bool m_bCanSeeStealth;
uint8 m_bInvisibilityType;
short m_sExchangeUser;
uint8 m_bExchangeOK;
ItemList m_ExchangeItemList;
bool m_bBlockPrivateChat;
short m_sPrivateChatUser;
time_t m_tHPLastTimeNormal; // For Automatic HP recovery.
time_t m_tHPStartTimeNormal;
short m_bHPAmountNormal;
uint8 m_bHPDurationNormal;
uint8 m_bHPIntervalNormal;
uint32 m_fSpeedHackClientTime, m_fSpeedHackServerTime;
uint8 m_bSpeedHackCheck;
time_t m_tBlinkExpiryTime; // When you should stop blinking.
uint32 m_bAbnormalType; // Is the player normal, a giant, or a dwarf?
uint32 m_nOldAbnormalType;
int16 m_sWhoKilledMe; // ID of the unit that killed you.
int64 m_iLostExp; // Experience points that were lost when you died.
time_t m_tLastTrapAreaTime; // The last moment you were in the trap area.
bool m_bZoneChangeFlag;
uint8 m_bRegeneType; // Did you die and go home or did you type '/town'?
time_t m_tLastRegeneTime; // The last moment you got resurrected.
bool m_bZoneChangeSameZone; // Did the server change when you warped?
int m_iSelMsgEvent[MAX_MESSAGE_EVENT];
short m_sEventNid, m_sEventSid;
uint32 m_nQuestHelperID;
bool m_bWeaponsDisabled;
TeamColour m_teamColour;
time_t m_fLastSkillUseTime;
uint8 m_bLastSkillType;
uint32 m_iLoyaltyDaily;
uint16 m_iLoyaltyPremiumBonus;
public:
INLINE bool isBanned() { return GetAuthority() == AUTHORITY_BANNED; }
INLINE bool isMuted() { return GetAuthority() == AUTHORITY_MUTED; }
INLINE bool isAttackDisabled() { return GetAuthority() == AUTHORITY_ATTACK_DISABLED; }
INLINE bool isGM() { return GetAuthority() == AUTHORITY_GAME_MASTER; }
INLINE bool isLimitedGM() { return GetAuthority() == AUTHORITY_LIMITED_GAME_MASTER; }
virtual bool isDead() { return m_bResHpType == USER_DEAD || m_sHp <= 0; }
virtual bool isBlinking() { return m_bAbnormalType == ABNORMAL_BLINKING; }
INLINE bool isInGame() { return GetState() == GAME_STATE_INGAME; }
INLINE bool isInParty() { return m_bInParty; }
INLINE bool isInClan() { return GetClanID() > 0; }
INLINE bool isKing() { return m_bRank == 1; }
INLINE bool isClanLeader() { return GetFame() == CHIEF; }
INLINE bool isClanAssistant() { return GetFame() == VICECHIEF; }
INLINE bool isPartyLeader() { return isInParty() && m_bPartyLeader; }
INLINE bool isWarrior() { return JobGroupCheck(ClassWarrior); }
INLINE bool isRogue() { return JobGroupCheck(ClassRogue); }
INLINE bool isMage() { return JobGroupCheck(ClassMage); }
INLINE bool isPriest() { return JobGroupCheck(ClassPriest); }
INLINE bool isBeginner()
{
uint16 sClass = GetClassType();
return (sClass <= ClassPriest);
}
INLINE bool isBeginnerWarrior() { return GetClassType() == ClassWarrior; }
INLINE bool isBeginnerRogue() { return GetClassType() == ClassRogue; }
INLINE bool isBeginnerMage() { return GetClassType() == ClassMage; }
INLINE bool isBeginnerPriest() { return GetClassType() == ClassPriest; }
INLINE bool isNovice()
{
uint16 sClass = GetClassType();
return (sClass == ClassWarriorNovice || sClass == ClassRogueNovice
|| sClass == ClassMageNovice || sClass == ClassPriestNovice);
}
INLINE bool isNoviceWarrior() { return GetClassType() == ClassWarriorNovice; }
INLINE bool isNoviceRogue() { return GetClassType() == ClassRogueNovice; }
INLINE bool isNoviceMage() { return GetClassType() == ClassMageNovice; }
INLINE bool isNovicePriest() { return GetClassType() == ClassPriestNovice; }
INLINE bool isMastered()
{
uint16 sClass = GetClassType();
return (sClass == ClassWarriorMaster || sClass == ClassRogueMaster
|| sClass == ClassMageMaster || sClass == ClassPriestMaster);
}
INLINE bool isMasteredWarrior() { return GetClassType() == ClassWarriorMaster; }
INLINE bool isMasteredRogue() { return GetClassType() == ClassRogueMaster; }
INLINE bool isMasteredMage() { return GetClassType() == ClassMageMaster; }
INLINE bool isMasteredPriest() { return GetClassType() == ClassPriestMaster; }
INLINE bool isTrading() { return m_sExchangeUser != -1; }
INLINE bool isStoreOpen() { return m_bStoreOpen; }
INLINE bool isMerchanting() { return GetMerchantState() != MERCHANT_STATE_NONE; }
INLINE bool isSellingMerchant() { return GetMerchantState() == MERCHANT_STATE_SELLING; }
INLINE bool isBuyingMerchant() { return GetMerchantState() == MERCHANT_STATE_BUYING; }
INLINE bool isMining() { return m_bMining; }
INLINE bool isBlockingPrivateChat() { return m_bBlockPrivateChat; }
INLINE bool isTransformed() { return m_transformationType != TransformationNone; }
INLINE bool isNPCTransformation() { return m_transformationType == TransformationNPC; }
INLINE bool isMonsterTransformation() { return m_transformationType == TransformationMonster; }
INLINE bool isSiegeTransformation() { return m_transformationType == TransformationSiege; }
INLINE bool isWeaponsDisabled() { return m_bWeaponsDisabled; }
INLINE bool isPVPZone() { return GetZoneID() == ZONE_ARDREAM || GetZoneID() == ZONE_RONARK_LAND || GetZoneID() == ZONE_RONARK_LAND_BASE; }
INLINE bool isInTempleEventZone() { return GetZoneID() == ZONE_BORDER_DEFENSE_WAR || GetZoneID() == ZONE_CHAOS_DUNGEON || GetZoneID() == ZONE_JURAD_MOUNTAIN; }
INLINE int8 GetMerchantState() { return m_bMerchantState; }
INLINE uint8 GetAuthority() { return m_bAuthority; }
INLINE uint8 GetFame() { return m_bFame; }
INLINE uint16 GetClass() { return m_sClass; }
/**
* @brief Gets the player's base class type, independent of nation.
*
* @return The class type.
*/
INLINE ClassType GetBaseClassType()
{
static const ClassType classTypes[] =
{
ClassWarrior, ClassRogue, ClassMage, ClassPriest,
ClassWarrior, ClassWarrior, // job changed / mastered
ClassRogue, ClassRogue, // job changed / mastered
ClassMage, ClassMage, // job changed / mastered
ClassPriest, ClassPriest // job changed / mastered
};
uint8 classType = GetClassType();
ASSERT(classType >= 1 && classType <= 12);
return classTypes[classType - 1];
}
/**
* @brief Gets class type, independent of nation.
*
* @return The class type.
*/
INLINE uint8 GetClassType()
{
return GetClass() % 100;
}
INLINE uint16 GetPartyID() { return m_sPartyIndex; }
INLINE int16 GetClanID() { return m_bKnights; }
INLINE void SetClanID(int16 val) { m_bKnights = val; }
INLINE uint32 GetCoins() { return m_iGold; }
INLINE uint32 GetInnCoins() { return m_iBank; }
INLINE uint32 GetLoyalty() { return m_iLoyalty; }
INLINE uint32 GetMonthlyLoyalty() { return m_iLoyaltyMonthly; }
INLINE uint32 GetManner() { return m_iMannerPoint; }
virtual int32 GetHealth() { return m_sHp; }
virtual int32 GetMaxHealth() { return m_iMaxHp; }
virtual int32 GetMana() { return m_sMp; }
virtual int32 GetMaxMana() { return m_iMaxMp; }
// Shortcuts for lazy people
INLINE bool hasCoins(uint32 amount) { return (GetCoins() >= amount); }
INLINE bool hasInnCoins(uint32 amount) { return (GetInnCoins() >= amount); }
INLINE bool hasLoyalty(uint32 amount) { return (GetLoyalty() >= amount); }
INLINE bool hasMonthlyLoyalty(uint32 amount) { return (GetMonthlyLoyalty() >= amount); }
INLINE bool hasManner(uint32 amount) { return (GetManner() >= amount); }
INLINE uint8 GetAngerGauge() { return m_byAngerGauge; }
INLINE bool hasFullAngerGauge() { return GetAngerGauge() >= MAX_ANGER_GAUGE; }
INLINE bool hasRival() { return GetRivalID() >= 0; }
INLINE bool hasRivalryExpired() { return UNIXTIME >= m_tRivalExpiryTime; }
INLINE int16 GetRivalID() { return m_sRivalID; }
INLINE GameState GetState() { return m_state; }
INLINE uint16 GetActiveQuestID() { return m_sEventDataIndex; }
uint8 GetClanGrade();
uint8 GetClanRank();
uint32 GetClanPoint();
void SendClanPointChange(int32 nChangeAmount = 0);
uint8 GetBeefRoastVictory();
uint8 GetRankReward(bool isMonthly);
INLINE uint8 GetStat(StatType type)
{
if (type >= STAT_COUNT)
return 0;
return m_bStats[type];
}
INLINE void SetStat(StatType type, uint8 val)
{
ASSERT(type < STAT_COUNT);
m_bStats[type] = val;
}
INLINE int32 GetStatTotal() // NOTE: Shares name with another, but lack-of args should be self-explanatory
{
int32 total = 0; // NOTE: this loop should be unrolled by the compiler
foreach_array (i, m_bStats)
total += m_bStats[i];
return total;
}
INLINE int16 GetStatItemBonus(StatType type)
{
ASSERT(type < STAT_COUNT);
return m_sStatItemBonuses[type];
}
INLINE int16 GetStatWithItemBonus(StatType type)
{
return GetStat(type) + GetStatItemBonus(type);
}
INLINE int32 GetStatItemBonusTotal()
{
int32 total = 0; // NOTE: this loop should be unrolled by the compiler
foreach_array (i, m_sStatItemBonuses)
total += m_sStatItemBonuses[i];
return total;
}
INLINE uint16 GetStatBonusTotal(StatType type)
{
return GetStatBuff(type) + GetStatItemBonus(type);
}
INLINE uint8 GetStatBuff(StatType type)
{
ASSERT(type < STAT_COUNT);
return m_bStatBuffs[type];
}
INLINE void SetStatBuff(StatType type, uint8 val)
{
ASSERT(type < STAT_COUNT);
m_bStatBuffs[type] = val;
}
INLINE uint32 GetStatBuffTotal()
{
uint32 total = 0; // NOTE: this loop should be unrolled by the compiler
foreach_array (i, m_bStatBuffs)
total += m_bStatBuffs[i];
return total;
}
INLINE uint16 getStatTotal(StatType type)
{
return GetStat(type) + GetStatItemBonus(type) + GetStatBuff(type);
}
INLINE uint16 GetTotalSkillPoints()
{
return m_bstrSkill[SkillPointFree] + m_bstrSkill[SkillPointCat1]
+ m_bstrSkill[SkillPointCat2] + m_bstrSkill[SkillPointCat3]
+ m_bstrSkill[SkillPointMaster];
}
INLINE uint8 GetSkillPoints(SkillPointCategory category)
{
if (category < SkillPointFree || category > SkillPointMaster)
return 0;
return m_bstrSkill[category];
}
INLINE _ITEM_DATA * GetItem(uint8 pos)
{
ASSERT(pos < INVENTORY_TOTAL);
return &m_sItemArray[pos];
}
INLINE _ITEM_TABLE * GetItemPrototype(uint8 pos)
{
_ITEM_DATA * pItem;
ASSERT(pos < INVENTORY_TOTAL);
return GetItemPrototype(pos, pItem);
}
_ITEM_TABLE * GetItemPrototype(uint8 pos, _ITEM_DATA *& pItem);
INLINE KOMap * GetMap() { return m_pMap; }
CUser(uint16 socketID, SocketMgr *mgr);
virtual void OnConnect();
virtual void OnDisconnect();
virtual bool HandlePacket(Packet & pkt);
void Update();
virtual void AddToRegion(int16 new_region_x, int16 new_region_z);
void SetRival(CUser * pRival);
void RemoveRival();
void SendLoyaltyChange(int32 nChangeAmount = 0, bool bIsKillReward = false);
void NativeZoneReturn();
void KickOutZoneUser(bool home = false, uint8 nZoneID = 21);
void TrapProcess();
bool JobGroupCheck(short jobgroupid);
void SendSay(int32 nTextID[8]);
void SelectMsg(uint8 bFlag, int32 nQuestID, int32 menuHeaderText,
int32 menuButtonText[MAX_MESSAGE_EVENT], int32 menuButtonEvents[MAX_MESSAGE_EVENT]);
bool CheckClass(short class1, short class2 = -1, short class3 = -1, short class4 = -1, short class5 = -1, short class6 = -1);
bool GiveItem(uint32 nItemID, uint16 sCount = 1, bool send_packet = true);
bool RobItem(uint32 nItemID, uint16 sCount = 1);
bool RobItem(uint8 bPos, _ITEM_TABLE * pTable, uint16 sCount = 1);
bool RobAllItemParty(uint32 nItemID, uint16 sCount = 1);
bool CheckExistItem(int itemid, short count = 1);
bool CheckExistItemAnd(int32 nItemID1, int16 sCount1, int32 nItemID2, int16 sCount2,
int32 nItemID3, int16 sCount3, int32 nItemID4, int16 sCount4, int32 nItemID5, int16 sCount5);
uint16 GetItemCount(uint32 nItemID);
bool CheckWeight(uint32 nItemID, uint16 sCount);
bool CheckWeight(_ITEM_TABLE * pTable, uint32 nItemID, uint16 sCount);
bool CheckSkillPoint(uint8 skillnum, uint8 min, uint8 max);
bool GoldLose(uint32 gold, bool bSendPacket = true);
void GoldGain(uint32 gold, bool bSendPacket = true, bool bApplyBonus = false);
void SendItemWeight();
void UpdateVisibility(InvisibilityType bNewType);
void ResetGMVisibility();
void BlinkStart();
void BlinkTimeCheck();
void GoldChange(short tid, int gold);
CUser * GetItemRoutingUser(uint32 nItemID, uint16 sCount);
bool GetStartPosition(short & x, short & y, uint8 bZone = 0);
int FindSlotForItem(uint32 nItemID, uint16 sCount = 1);
int GetEmptySlot();
void SendAllKnightsID();
void SendStackChange(uint32 nItemID, uint32 nCount /* needs to be 4 bytes, not a bug */, uint16 sDurability, uint8 bPos, bool bNewItem = false);
void Type4Duration();
void HPTimeChange();
void HPTimeChangeType3();
short GetDamage(Unit *pTarget, _MAGIC_TABLE *pSkill = nullptr, bool bPreviewOnly = false);
void OnAttack(Unit * pTarget, AttackType attackType);
void OnDefend(Unit * pAttacker, AttackType attackType);
bool TriggerProcItem(uint8 bSlot, Unit * pTarget, ItemTriggerType triggerType);
void SendDurability(uint8 slot, uint16 durability);
void SendItemMove(uint8 subcommand);
void ItemWoreOut( int type, int damage );
void Dead();
void GetUserInfoForAI(Packet & result);
bool ItemEquipAvailable( _ITEM_TABLE* pTable );
virtual void HpChange(int amount, Unit *pAttacker = nullptr, bool bSendToAI = true);
virtual void MSpChange(int amount);
void SendPartyHPUpdate();
void ShowEffect(uint32 nSkillID);
void ShowNpcEffect(uint32 nEffectID);
void SendAnvilRequest(uint16 sNpcID, uint8 bType = ITEM_UPGRADE_REQ);
void RecastSavedMagic(bool bFillToMaxHealth = false);
// packet handlers start here
void VersionCheck(Packet & pkt);
void LoginProcess(Packet & pkt);
void SelNationToAgent(Packet & pkt);
void AllCharInfoToAgent();
void ChangeHair(Packet & pkt);
void NewCharToAgent(Packet & pkt);
void DelCharToAgent(Packet & pkt);
void SelCharToAgent(Packet & pkt);
void SelectCharacter(Packet & pkt); // from the database
void SetLogInInfoToDB(uint8 bInit);
void RecvLoginInfo(Packet & pkt); // from the database
void SpeedHackTime(Packet & pkt);
void TempleProcess(Packet & pkt );
void TempleOperations(uint8 bType = 0);
void MonsterStoneProcess();
void GameStart(Packet & pkt);
void RentalSystem(Packet & pkt);
void SkillDataProcess(Packet & pkt);
void SkillDataSave(Packet & pkt);
void SkillDataLoad();
void MoveProcess(Packet & pkt);
void Rotate(Packet & pkt);
void Attack(Packet & pkt);
void CheckSeedQuest();
static void InitChatCommands();
static void CleanupChatCommands();
void Chat(Packet & pkt);
void ChatTargetSelect(Packet & pkt);
void SendDeathNotice(Unit * pKiller, DeathNoticeType noticeType);
bool ProcessChatCommand(std::string & message);
uint8 GetUserDailyOp(uint8 type = 0);
void SetUserDailyOp(uint8 type = 0, bool isInsert = false);
COMMAND_HANDLER(HandleTestCommand);
COMMAND_HANDLER(HandleGiveItemCommand);
COMMAND_HANDLER(HandleZoneChangeCommand);
COMMAND_HANDLER(HandleMonsterSummonCommand);
COMMAND_HANDLER(HandleNPCSummonCommand);
COMMAND_HANDLER(HandleWar1OpenCommand);
COMMAND_HANDLER(HandleWar2OpenCommand);
COMMAND_HANDLER(HandleWar3OpenCommand);
COMMAND_HANDLER(HandleWar4OpenCommand);
COMMAND_HANDLER(HandleWar5OpenCommand);
COMMAND_HANDLER(HandleWar6OpenCommand);
COMMAND_HANDLER(HandleCaptainCommand);
COMMAND_HANDLER(HandleSnowWarOpenCommand);
COMMAND_HANDLER(HandleWarCloseCommand);
COMMAND_HANDLER(HandleShutdownCommand);
COMMAND_HANDLER(HandleLoyaltyChangeCommand);
COMMAND_HANDLER(HandleExpChangeCommand);
COMMAND_HANDLER(HandleGoldChangeCommand);
COMMAND_HANDLER(HandleExpAddCommand); /* for the server XP event */
COMMAND_HANDLER(HandleMoneyAddCommand); /* for the server coin event */
COMMAND_HANDLER(HandlePermitConnectCommand);
COMMAND_HANDLER(HandleTeleportAllCommand);
void Regene(uint8 regene_type, uint32 magicid = 0);
void RequestUserIn(Packet & pkt);
void RequestNpcIn(Packet & pkt);
void RecvWarp(Packet & pkt);
void Warp(uint16 sPosX, uint16 sPosZ);
void ItemMove(Packet & pkt);
void NpcEvent(Packet & pkt);
void ItemTrade(Packet & pkt);
void BundleOpenReq(Packet & pkt);
void ItemGet(Packet & pkt);
CUser * GetLootUser(_LOOT_BUNDLE * pBundle, _LOOT_ITEM * pItem);
void RecvZoneChange(Packet & pkt);
void PointChange(Packet & pkt);
void StateChange(Packet & pkt);
virtual void StateChangeServerDirect(uint8 bType, uint32 nBuff);
void PartyProcess(Packet & pkt);
void PartyDelete();
void PartyPromote(uint16 sMemberID);
void PartyRemove( int memberid );
void PartyInsert();
void PartyCancel();
void PartyRequest( int memberid, bool bCreate );
// Trade system
void ExchangeProcess(Packet & pkt);
void ExchangeReq(Packet & pkt);
void ExchangeAgree(Packet & pkt);
void ExchangeAdd(Packet & pkt);
void ExchangeDecide();
void ExchangeCancel();
void InitExchange(bool bStart);
bool CheckExchange();
bool ExecuteExchange();
// Merchant system (both types)
void MerchantProcess(Packet & pkt);
void GiveMerchantItems();
// regular merchants
void MerchantOpen();
void MerchantClose();
void MerchantItemAdd(Packet & pkt);
void MerchantItemCancel(Packet & pkt);
void MerchantItemList(Packet & pkt);
void MerchantItemBuy(Packet & pkt);
void MerchantInsert(Packet & pkt);
void CancelMerchant();
// buying merchants
void BuyingMerchantOpen(Packet & pkt);
void BuyingMerchantClose();
void BuyingMerchantInsert(Packet & pkt);
void BuyingMerchantInsertRegion();
void BuyingMerchantList(Packet & pkt);
void BuyingMerchantBuy(Packet & pkt);
void RemoveFromMerchantLookers();
void SkillPointChange(Packet & pkt);
void ObjectEvent(Packet & pkt);
bool BindObjectEvent(_OBJECT_EVENT *pEvent);
bool GateLeverObjectEvent(_OBJECT_EVENT *pEvent, int nid);
bool FlagObjectEvent(_OBJECT_EVENT *pEvent, int nid);
bool WarpListObjectEvent(_OBJECT_EVENT *pEvent);
void UpdateGameWeather(Packet & pkt);
void ClassChange(Packet & pkt, bool bFromClient = true);
void ClassChangeReq();
void SendStatSkillDistribute();
void AllPointChange();
void AllSkillPointChange();
void CountConcurrentUser();
void UserDataSaveToAgent();
void ItemRepair(Packet & pkt);
void ItemRemove(Packet & pkt);
void OperatorCommand(Packet & pkt);
void WarehouseProcess(Packet & pkt);
void Home();
void FriendProcess(Packet & pkt);
void FriendRequest();
void FriendModify(Packet & pkt, uint8 opcode);
void RecvFriendModify(Packet & pkt, uint8 opcode);
void FriendReport(Packet & pkt);
uint8 GetFriendStatus(std::string & charName, int16 & sid);
void SelectWarpList(Packet & pkt);
bool GetWarpList( int warp_group );
void ServerChangeOk(Packet & pkt);
void PartyBBS(Packet & pkt);
void PartyBBSRegister(Packet & pkt);
void PartyBBSDelete(Packet & pkt);
void PartyBBSNeeded(Packet & pkt, uint8 type);
void PartyBBSWanted(Packet & pkt);
uint8 GetPartyMemberAmount(_PARTY_GROUP *pParty = nullptr);
void SendPartyBBSNeeded(uint16 page_index, uint8 bType);
void ClientEvent(uint16 sNpcID);
void KissUser();
void RecvSelectMsg(Packet & pkt);
bool AttemptSelectMsg(uint8 bMenuID, int8 bySelectedReward);
// from the client
void ItemUpgradeProcess(Packet & pkt);
void ItemUpgrade(Packet & pkt, bool isRebirth = false);
void ItemUpgradeNotice(_ITEM_TABLE * pItem, uint8 UpgradeResult);
void ItemUpgradeAccessories(Packet & pkt);
void BifrostPieceProcess(Packet & pkt); // originally named BeefRoastPieceProcess() -- that's not happening.
void SpecialItemExchange(Packet & pkt);
void ItemUpgradeRebirth(Packet & pkt);
void ItemSealProcess(Packet & pkt);
void SealItem(uint8 bSealType, uint8 bSrcPos);
void CharacterSealProcess(Packet & pkt);
void ShoppingMall(Packet & pkt);
void HandleStoreOpen(Packet & pkt);
void HandleStoreClose();
void LetterSystem(Packet & pkt);
void ReqLetterSystem(Packet & pkt);
void ReqLetterUnread();
void ReqLetterList(bool bNewLettersOnly = true);
void ReqLetterRead(Packet & pkt);
void ReqLetterSend(Packet & pkt);
void ReqLetterGetItem(Packet & pkt);
void ReqLetterDelete(Packet & pkt);
void HandleNameChange(Packet & pkt);
void HandlePlayerNameChange(Packet & pkt);
void SendNameChange(NameChangeOpcode opcode = NameChangeShowDialog);
void HandleHelmet(Packet & pkt);
void HandleCapeChange(Packet & pkt);
void HandleChallenge(Packet & pkt);
void HandleChallengeRequestPVP(Packet & pkt);
void HandleChallengeRequestCVC(Packet & pkt);
void HandleChallengeAcceptPVP(Packet & pkt);
void HandleChallengeAcceptCVC(Packet & pkt);
void HandleChallengeCancelled(uint8 opcode);
void HandleChallengeRejected(uint8 opcode);
void HandlePlayerRankings(Packet & pkt);
void HandleMiningSystem(Packet & pkt);
void HandleMiningStart(Packet & pkt);
void HandleMiningAttempt(Packet & pkt);
void HandleMiningStop(Packet & pkt);
void HandleSoccer(Packet & pkt);
void SendNotice();
void AppendNoticeEntry(Packet & pkt, uint8 & elementCount, const char * message, const char * title);
void AppendExtraNoticeData(Packet & pkt, uint8 & elementCount);
void UserLookChange( int pos, int itemid, int durability );
void SpeedHackUser();
void LoyaltyChange(int16 tid, uint16 bonusNP = 0);
void LoyaltyDivide(int16 tid, uint16 bonusNP = 0);
void GrantChickenManner();
void SendMannerChange(int32 iMannerPoints);
bool CanLevelQualify(uint8 sLevel);
bool CanChangeZone(C3DMap * pTargetMap, WarpListResponse & errorReason);
void ZoneChange(uint16 sNewZone, float x, float z);
void ZoneChangeParty(uint16 sNewZone, float x, float z);
void ZoneChangeClan(uint16 sNewZone, float x, float z);
void PlayerRankingProcess(uint16 ZoneID, bool RemoveInZone = false);
void AddPlayerRank(uint16 ZoneID);
void RemovePlayerRank();
void UpdatePlayerRank();
void AddEventUser(CUser * pUser = nullptr);
void RemoveEventUser(uint16 m_socketID);
void UpdateEventUser(uint16 m_socketID, int16 nUserGroup = -1);
bool isEventUser(uint16 m_socketID);
void SendTargetHP( uint8 echo, int tid, int damage = 0 );
bool IsValidSlotPos( _ITEM_TABLE* pTable, int destpos );
void SetUserAbility(bool bSendPacket = true);
void LevelChange(short level, bool bLevelUp = true);
void SetSlotItemValue();
void ApplySetItemBonuses(_SET_ITEM * pItem);
void SendTime();
void SendWeather();
void SendPremiumInfo();
void SetZoneAbilityChange(uint16 sNewZone);
void SetMaxMp();
void SetMaxHp(int iFlag = 0);
void RecvUserExp(Packet & pkt);
void ExpChange(int64 iExp);
void LogOut();
void SendMyInfo();
void SendServerChange(std::string & ip, uint8 bInit);
void Send2AI_UserUpdateInfo(bool initialInfo = false);
uint16 GetPremiumProperty(uint8 type);
void BifrostProcess(CUser * pUser);
virtual void GetInOut(Packet & result, uint8 bType);
void UserInOut(uint8 bType);
void GetUserInfo(Packet & pkt);
void SendUserStatusUpdate(UserStatus type, UserStatusBehaviour status);
virtual void Initialize();
void ChangeFame(uint8 bFame);
void SendServerIndex();
void SendToRegion(Packet *pkt, CUser *pExceptUser = nullptr);
void SendToZone(Packet *pkt, CUser *pExceptUser = nullptr);
virtual void OnDeath(Unit *pKiller);
void UpdateAngerGauge(uint8 byAngerGauge);
void InitializeStealth();
// Exchange system
bool CheckExchange(int nExchangeID);
bool RunExchange(int nExchangeID, uint16 count = 0 /* No random flag */);
uint16 GetMaxExchange(int nExchangeID);
// Clan system
void SendClanUserStatusUpdate(bool bToRegion = true);
void SendPartyStatusUpdate(uint8 bStatus, uint8 bResult = 0);
bool CanUseItem(uint32 nItemID, uint16 sCount = 1);
void CheckSavedMagic();
virtual void InsertSavedMagic(uint32 nSkillID, uint16 sDuration);
virtual void RemoveSavedMagic(uint32 nSkillID);
virtual bool HasSavedMagic(uint32 nSkillID);
virtual int16 GetSavedMagicDuration(uint32 nSkillID);
void SaveEvent(uint16 sQuestID, uint8 bQuestState);
void DeleteEvent(uint16 sQuestID);
bool CheckExistEvent(uint16 sQuestID, uint8 bQuestState);
void QuestV2MonsterCountAdd(uint16 sNpcID);
uint8 QuestV2CheckMonsterCount(uint16 sQuestID);
void QuestV2MonsterDataDeleteAll();
// Sends the quest completion statuses
void QuestDataRequest();
// Handles new quest packets
void QuestV2PacketProcess(Packet & pkt);
void QuestV2MonsterDataRequest();
void QuestV2ExecuteHelper(_QUEST_HELPER * pQuestHelper);
void QuestV2CheckFulfill(_QUEST_HELPER * pQuestHelper);
bool QuestV2RunEvent(_QUEST_HELPER * pQuestHelper, uint32 nEventID, int8 bSelectedReward = -1);
void QuestV2SaveEvent(uint16 sQuestID);
void QuestV2SendNpcMsg(uint32 nQuestID, uint16 sNpcID);
void QuestV2ShowGiveItem(uint32 nUnk1, uint16 sUnk1,
uint32 nUnk2, uint16 sUnk2,
uint32 nUnk3, uint16 sUnk3,
uint32 nUnk4, uint16 sUnk4,
uint32 nUnk5 = 0, uint16 sUnk5 = 0);
uint16 QuestV2SearchEligibleQuest(uint16 sNpcID);
void QuestV2ShowMap(uint32 nQuestHelperID);
uint8 CheckMonsterCount(uint8 bGroup);
bool PromoteUserNovice();
bool PromoteUser();
void PromoteClan(ClanTypeFlag byFlag);
// Attack/zone checks
bool isHostileTo(Unit * pTarget);
bool isInArena();
bool isInPVPZone();
bool isInSafetyArea();
void ResetWindows();
void CloseProcess();
virtual ~CUser() {}
/* Database requests */
void ReqAccountLogIn(Packet & pkt);
void ReqSelectNation(Packet & pkt);
void ReqAllCharInfo(Packet & pkt);
void ReqChangeHair(Packet & pkt);
void ReqCreateNewChar(Packet & pkt);
void ReqDeleteChar(Packet & pkt);
void ReqSelectCharacter(Packet & pkt);
void ReqSaveCharacter();
void ReqUserLogOut();
void ReqRegisterClanSymbol(Packet & pkt);
void ReqSetLogInInfo(Packet & pkt);
void ReqUserKickOut(Packet & pkt);
// void BattleEventResult(Packet & pkt);
void ReqShoppingMall(Packet & pkt);
void ReqLoadWebItemMall();
void ReqSkillDataProcess(Packet & pkt);
void ReqSkillDataSave(Packet & pkt);
void ReqSkillDataLoad(Packet & pkt);
void ReqFriendProcess(Packet & pkt);
void ReqRequestFriendList(Packet & pkt);
void ReqAddFriend(Packet & pkt);
void ReqRemoveFriend(Packet & pkt);
void ReqChangeName(Packet & pkt);
void ReqChangeCape(Packet & pkt);
void ReqSealItem(Packet & pkt);
//private:
static ChatCommandTable s_commandTable;
GameState m_state;
// quest ID | quest state (need to replace with enum)
typedef std::map<uint16, uint8> QuestMap;
QuestMap m_questMap;
uint8 m_bKillCounts[QUEST_MOB_GROUPS];
uint16 m_sEventDataIndex;
UserSavedMagicMap m_savedMagicMap;
FastMutex m_savedMagicLock;
_KNIGHTS_USER * m_pKnightsUser;
public:
DECLARE_LUA_CLASS(CUser);
// Standard getters
DECLARE_LUA_GETTER(GetName)
DECLARE_LUA_GETTER(GetAccountName)
DECLARE_LUA_GETTER(GetZoneID)
DECLARE_LUA_GETTER(GetX)
DECLARE_LUA_GETTER(GetY)
DECLARE_LUA_GETTER(GetZ)
DECLARE_LUA_GETTER(GetNation)
DECLARE_LUA_GETTER(GetLevel)
DECLARE_LUA_GETTER(GetClass)
DECLARE_LUA_GETTER(GetCoins)
DECLARE_LUA_GETTER(GetInnCoins)
DECLARE_LUA_GETTER(GetLoyalty)
DECLARE_LUA_GETTER(GetMonthlyLoyalty)
DECLARE_LUA_GETTER(GetManner)
DECLARE_LUA_GETTER(GetActiveQuestID)
DECLARE_LUA_GETTER(GetClanGrade)
DECLARE_LUA_GETTER(GetClanPoint)
DECLARE_LUA_GETTER(GetClanRank)
DECLARE_LUA_GETTER(isWarrior)
DECLARE_LUA_GETTER(isRogue)
DECLARE_LUA_GETTER(isMage)
DECLARE_LUA_GETTER(isPriest)
DECLARE_LUA_GETTER(isBeginner)
DECLARE_LUA_GETTER(isBeginnerWarrior)
DECLARE_LUA_GETTER(isBeginnerRogue)
DECLARE_LUA_GETTER(isBeginnerMage)
DECLARE_LUA_GETTER(isBeginnerPriest)
DECLARE_LUA_GETTER(isNovice)
DECLARE_LUA_GETTER(isNoviceWarrior)
DECLARE_LUA_GETTER(isNoviceRogue)
DECLARE_LUA_GETTER(isNoviceMage)
DECLARE_LUA_GETTER(isNovicePriest)
DECLARE_LUA_GETTER(isMastered)
DECLARE_LUA_GETTER(isMasteredWarrior)
DECLARE_LUA_GETTER(isMasteredRogue)
DECLARE_LUA_GETTER(isMasteredMage)
DECLARE_LUA_GETTER(isMasteredPriest)
DECLARE_LUA_GETTER(isInClan)
DECLARE_LUA_GETTER(isClanLeader)
DECLARE_LUA_GETTER(isInParty)
DECLARE_LUA_GETTER(isPartyLeader)
DECLARE_LUA_GETTER(isKing)
DECLARE_LUA_GETTER(GetBeefRoastVictory)
DECLARE_LUA_GETTER(GetPartyMemberAmount)
// Shortcuts for lazy people
DECLARE_LUA_FUNCTION(hasCoins) {
LUA_RETURN(LUA_GET_INSTANCE()->hasCoins(LUA_ARG(uint32, 2)));
}
DECLARE_LUA_FUNCTION(hasInnCoins) {
LUA_RETURN(LUA_GET_INSTANCE()->hasInnCoins(LUA_ARG(uint32, 2)));
}
DECLARE_LUA_FUNCTION(hasLoyalty) {
LUA_RETURN(LUA_GET_INSTANCE()->hasLoyalty(LUA_ARG(uint32, 2)));
}
DECLARE_LUA_FUNCTION(hasMonthlyLoyalty) {
LUA_RETURN(LUA_GET_INSTANCE()->hasMonthlyLoyalty(LUA_ARG(uint32, 2)));
}
DECLARE_LUA_FUNCTION(hasManner) {
LUA_RETURN(LUA_GET_INSTANCE()->hasManner(LUA_ARG(uint32, 2)));
}
// The useful method wrappers
DECLARE_LUA_FUNCTION(GiveItem) {
LUA_RETURN(LUA_GET_INSTANCE()->GiveItem(
LUA_ARG(uint32, 2),
LUA_ARG_OPTIONAL(uint16, 1, 3),
true /* send packet */));
}
DECLARE_LUA_FUNCTION(RobItem) {
LUA_RETURN(LUA_GET_INSTANCE()->RobItem(
LUA_ARG(uint32, 2),
LUA_ARG_OPTIONAL(uint16, 1, 3)));
}
DECLARE_LUA_FUNCTION(RobAllItemParty) {
LUA_RETURN(LUA_GET_INSTANCE()->RobAllItemParty(
LUA_ARG(uint32, 2),
LUA_ARG_OPTIONAL(uint16, 1, 3)));
}
DECLARE_LUA_FUNCTION(CheckExistItem) {
LUA_RETURN(LUA_GET_INSTANCE()->CheckExistItem(
LUA_ARG(uint32, 2),
LUA_ARG_OPTIONAL(uint16, 1, 3)));
}
DECLARE_LUA_FUNCTION(GoldGain) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->GoldGain(LUA_ARG(int32, 2)));
}
DECLARE_LUA_FUNCTION(GoldLose) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->GoldLose(LUA_ARG(uint32, 2)));
}
DECLARE_LUA_FUNCTION(ExpChange) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->ExpChange(LUA_ARG(int32, 2)));
}
DECLARE_LUA_FUNCTION(SaveEvent) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->QuestV2SaveEvent(
LUA_ARG(uint16, 2))); // quest ID
}
DECLARE_LUA_FUNCTION(SearchQuest) {
CUser * pUser = LUA_GET_INSTANCE();
LUA_RETURN(pUser->QuestV2SearchEligibleQuest(LUA_ARG_OPTIONAL(uint16, pUser->m_sEventSid, 2))); // NPC ID
}
DECLARE_LUA_FUNCTION(ShowMap) {
CUser * pUser = LUA_GET_INSTANCE();
LUA_NO_RETURN(pUser->QuestV2ShowMap(LUA_ARG_OPTIONAL(uint32, pUser->m_nQuestHelperID, 2))); // quest helper ID
}
DECLARE_LUA_FUNCTION(CountMonsterQuestSub) {
LUA_RETURN(LUA_GET_INSTANCE()->QuestV2CheckMonsterCount((LUA_ARG(uint16, 2))));
}
DECLARE_LUA_FUNCTION(NpcSay) {
CUser * pUser = LUA_GET_INSTANCE();
uint32 arg = 2; // start from after the user instance.
int32 nTextID[8];
foreach_array(i, nTextID)
nTextID[i] = LUA_ARG_OPTIONAL(int32, -1, arg++);
LUA_NO_RETURN(pUser->SendSay(nTextID));
}
// This is probably going to be cleaned up, as the methodology behind these menus is kind of awful.
// For now, we'll just copy existing behaviour: that is, pass along a set of text IDs & button IDs.
DECLARE_LUA_FUNCTION(SelectMsg) {
CUser * pUser = LUA_GET_INSTANCE();
uint32 arg = 2; // start from after the user instance.
int32 menuButtonText[MAX_MESSAGE_EVENT],
menuButtonEvents[MAX_MESSAGE_EVENT];
uint8 bFlag = LUA_ARG(uint8, arg++);
int32 nQuestID = LUA_ARG_OPTIONAL(int32, -1, arg++);
int32 menuHeaderText = LUA_ARG(int32, arg++);
foreach_array(i, menuButtonText)
{
menuButtonText[i] = LUA_ARG_OPTIONAL(int32, -1, arg++);
menuButtonEvents[i] = LUA_ARG_OPTIONAL(int32, -1, arg++);
}
LUA_NO_RETURN(pUser->SelectMsg(bFlag, nQuestID, menuHeaderText, menuButtonText, menuButtonEvents));
}
DECLARE_LUA_FUNCTION(NpcMsg) {
CUser * pUser = LUA_GET_INSTANCE();
LUA_NO_RETURN(pUser->QuestV2SendNpcMsg(
LUA_ARG(uint32, 2),
LUA_ARG_OPTIONAL(uint16, pUser->m_sEventSid, 3)));
}
DECLARE_LUA_FUNCTION(CheckWeight) {
LUA_RETURN(LUA_GET_INSTANCE()->CheckWeight(
LUA_ARG(uint32, 2), // item ID
LUA_ARG_OPTIONAL(uint16, 1, 3))); // stack size
}
DECLARE_LUA_FUNCTION(CheckSkillPoint) {
LUA_RETURN(LUA_GET_INSTANCE()->CheckSkillPoint(
LUA_ARG(uint8, 2), // skill point category
LUA_ARG(uint8, 3), // min
LUA_ARG(uint8, 4))); // max
}
DECLARE_LUA_FUNCTION(isRoomForItem) {
LUA_RETURN(LUA_GET_INSTANCE()->FindSlotForItem(
LUA_ARG(uint32, 2), // item ID
LUA_ARG_OPTIONAL(uint16, 1, 3))); // stack size
}
DECLARE_LUA_FUNCTION(CheckExchange) {
LUA_RETURN(LUA_GET_INSTANCE()->CheckExchange(LUA_ARG(uint32, 2))); // exchange ID
}
DECLARE_LUA_FUNCTION(RunExchange) {
LUA_RETURN(LUA_GET_INSTANCE()->RunExchange(LUA_ARG(uint32, 2))); // exchange ID
}
DECLARE_LUA_FUNCTION(KissUser) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->KissUser());
}
DECLARE_LUA_FUNCTION(PromoteUserNovice) {
LUA_RETURN(LUA_GET_INSTANCE()->PromoteUserNovice());
}
DECLARE_LUA_FUNCTION(PromoteUser) {
LUA_RETURN(LUA_GET_INSTANCE()->PromoteUser());
}
DECLARE_LUA_FUNCTION(ShowEffect) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->ShowEffect(LUA_ARG(uint32, 2))); // effect ID
}
DECLARE_LUA_FUNCTION(ShowNpcEffect) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->ShowNpcEffect(LUA_ARG(uint32, 2))); // effect ID
}
DECLARE_LUA_FUNCTION(ZoneChange) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->ZoneChange(
LUA_ARG(uint16, 2), // zone ID
LUA_ARG(float, 3), // x
LUA_ARG(float, 4))); // z
}
DECLARE_LUA_FUNCTION(ZoneChangeParty) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->ZoneChangeParty(
LUA_ARG(uint16, 2), // zone ID
LUA_ARG(float, 3), // x
LUA_ARG(float, 4))); // z
}
DECLARE_LUA_FUNCTION(ZoneChangeClan) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->ZoneChangeClan(
LUA_ARG(uint16, 2), // zone ID
LUA_ARG(float, 3), // x
LUA_ARG(float, 4))); // z
}
DECLARE_LUA_FUNCTION(SendNameChange) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->SendNameChange());
}
DECLARE_LUA_FUNCTION(SendStatSkillDistribute) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->SendStatSkillDistribute());
}
DECLARE_LUA_FUNCTION(ResetStatPoints) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->AllPointChange());
}
DECLARE_LUA_FUNCTION(ResetSkillPoints) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->AllSkillPointChange());
}
DECLARE_LUA_FUNCTION(GiveLoyalty) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->SendLoyaltyChange(LUA_ARG(int32, 2)));
}
DECLARE_LUA_FUNCTION(RobLoyalty) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->SendLoyaltyChange(-(LUA_ARG(int32, 2))));
}
DECLARE_LUA_FUNCTION(ChangeManner) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->SendMannerChange(LUA_ARG(int32, 2)));
}
DECLARE_LUA_FUNCTION(PromoteClan) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->PromoteClan((ClanTypeFlag) LUA_ARG_OPTIONAL(uint8, ClanTypePromoted, 2)));
}
DECLARE_LUA_FUNCTION(GetStat) {
LUA_RETURN(LUA_GET_INSTANCE()->GetStat((StatType)(LUA_ARG(uint8, 2) + 1)));
}
DECLARE_LUA_FUNCTION(RobClanPoint) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->SendClanPointChange(-(LUA_ARG(int32, 2))));
}
DECLARE_LUA_FUNCTION(RequestPersonalRankReward) {
LUA_RETURN(LUA_GET_INSTANCE()->GetRankReward(true));
}
DECLARE_LUA_FUNCTION(RequestReward) {
LUA_RETURN(LUA_GET_INSTANCE()->GetRankReward(false));
}
DECLARE_LUA_FUNCTION(RunCountExchange) {
LUA_NO_RETURN(LUA_GET_INSTANCE()->RunExchange(
LUA_ARG(int, 2),
LUA_ARG(uint16, 3)));
}
DECLARE_LUA_FUNCTION(GetMaxExchange) {
LUA_RETURN(LUA_GET_INSTANCE()->GetMaxExchange((LUA_ARG(int, 2))));
}
DECLARE_LUA_FUNCTION(GetUserDailyOp) {
LUA_RETURN(LUA_GET_INSTANCE()->GetUserDailyOp((LUA_ARG(uint8, 2))));
}
}; | [
"akuma@xskip.net"
] | akuma@xskip.net |
5b79c61e60c3a09989f26fbe318adb3647361589 | e4956c597199a3ae8e7dd655e19074aee97fddf0 | /ListNode.hpp | 2cd8bf53ba164d27bcf48042dd7c0871de8099e3 | [] | no_license | mihaelaberindea/practica | b0fd800c82c6d65e979e8b1510160ac280c2b25a | f781585605c5fb45af0b890be4d873ae32d705b5 | refs/heads/master | 2022-12-20T10:28:34.170529 | 2020-09-22T12:45:27 | 2020-09-22T12:45:27 | 278,428,116 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 722 | hpp | #ifndef LISTNODE_HPP
#define LISTNODE_HPP
#include <cstddef>
template <typename T>
class ListNode
{
public:
ListNode(ListNode* prev, ListNode* next, T data);
ListNode(const ListNode &rhs)=default;
~ListNode();
ListNode<T>& operator=(const ListNode& rhs);
template <typename U>
friend std::ostream& operator<<(std::ostream& os, const ListNode<U>& vec);
ListNode* getPrev();
ListNode* getNext();
void setPrev(ListNode* prev);
void setNext(ListNode* next);
T& getData();
void setData(ListNode* data);
void setDataT(T data);
void print();
private:
ListNode* m_prev;
ListNode* m_next;
T m_data;
};
#include "ListNode.tpp"
#endif // LISTNODE_HPP | [
"root@DESKTOP-THV13T4.localdomain"
] | root@DESKTOP-THV13T4.localdomain |
94b732815d28da5280ffd8a20788d7ca8b2a7982 | 8ec0b37723036878a5643016b5a891379f4d7939 | /Client/include/UDPClient.hpp | f727a248e111e891fc7f99419381260fa3d0f241 | [] | no_license | huxiaofengaaa/SmartHomePlatform | 06c61379cf8a3e14be95fefd6aabe1042bc555b8 | 29524982c4e50f3ac8f4accd1c7269a1440fdd2d | refs/heads/master | 2020-03-22T00:15:29.170934 | 2018-08-21T12:29:39 | 2018-08-21T12:29:39 | 139,233,722 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 667 | hpp | #ifndef CLIENT_INCLUDE_UDPCLIENT_HPP_
#define CLIENT_INCLUDE_UDPCLIENT_HPP_
#include <string>
class UDPClient
{
public:
UDPClient(std::string p_host, int p_port);
virtual ~UDPClient();
bool startUDPClient();
void shutDownUDPClient();
int writeUDPString(std::string p_data);
std::string readUDPString(int p_timeout);
std::string writeAndReadUDPString(std::string p_data);
std::string getLocalUDPHost();
int getLocalUDPPort();
private:
int create_an_udp_socket_client(std::string p_host, int p_port);
const std::string m_host;
const int m_port;
int m_sockfd;
std::string m_localhost;
int m_localPort;
};
#endif /* CLIENT_INCLUDE_UDPCLIENT_HPP_ */
| [
"huxiaofengaaa@126.com"
] | huxiaofengaaa@126.com |
20835da0076b53bf3201c3d8c08ccdfe389d370c | 32e2539f62c9f2e5bbeadae8b29dcb2cbfc72019 | /GameNangCao/Classes/HelloWorldScene.h | bd46488393fdcef9fcc29ff262405347c0babe0c | [] | no_license | sipv1612/BattleCityMultiplayer | 300c32ab993089f811a580deed04a0c31af9c902 | e49b7b61c29cde77c07c7a7631a5ad9895e9df9d | refs/heads/master | 2020-03-19T14:52:17.698539 | 2018-06-14T19:40:52 | 2018-06-14T19:41:10 | 136,644,174 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 510 | h | #ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
#include "GameStart.h"
class HelloWorld : public cocos2d::Layer
{
private:
public:
static cocos2d::Scene* createScene();
cocos2d::Sprite *mTank[4];
virtual bool init();
bool isTeam = false;
// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);
void update(float delta);
// implement the "static create()" method manually
CREATE_FUNC(HelloWorld);
};
#endif // __HELLOWORLD_SCENE_H__
| [
"sipv1612@gmail.com"
] | sipv1612@gmail.com |
09ab145bef4c2895c99d8335c2eb4051fcf9eba5 | db7148c33aabad259c9e1acafdf6e5c49b627d46 | /Tests/Armory/build_test_game/osx-build/Sources/src/kha/math/Quaternion.cpp | 4cfbdcc491bc02d4b483bf9dd2d7e3d060ba7b62 | [] | no_license | templeblock/Animations | 18472430af796d32e3f0c9dd2df1058fdb241846 | e986fa2249b998889fad78cac6ff3cc70ad196f0 | refs/heads/master | 2020-04-23T01:23:44.200377 | 2018-06-07T14:33:43 | 2018-06-07T14:33:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 35,287 | cpp | // Generated by Haxe 3.4.4
#include <hxcpp.h>
#ifndef INCLUDED_95f339a1d026d52c
#define INCLUDED_95f339a1d026d52c
#include "hxMath.h"
#endif
#ifndef INCLUDED_kha_math_Matrix4
#include <kha/math/Matrix4.h>
#endif
#ifndef INCLUDED_kha_math_Quaternion
#include <kha/math/Quaternion.h>
#endif
#ifndef INCLUDED_kha_math_Vector3
#include <kha/math/Vector3.h>
#endif
HX_DEFINE_STACK_FRAME(_hx_pos_002fcb5d014f4211_10_new,"kha.math.Quaternion","new",0xc02c67cc,"kha.math.Quaternion.new","kha/math/Quaternion.hx",10,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_29_slerp,"kha.math.Quaternion","slerp",0x578312d6,"kha.math.Quaternion.slerp","kha/math/Quaternion.hx",29,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_56_rotated,"kha.math.Quaternion","rotated",0x2dd40715,"kha.math.Quaternion.rotated","kha/math/Quaternion.hx",56,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_67_scaled,"kha.math.Quaternion","scaled",0x09e8beae,"kha.math.Quaternion.scaled","kha/math/Quaternion.hx",67,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_70_scale,"kha.math.Quaternion","scale",0x518d18f6,"kha.math.Quaternion.scale","kha/math/Quaternion.hx",70,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_77_matrix,"kha.math.Quaternion","matrix",0x898b0a55,"kha.math.Quaternion.matrix","kha/math/Quaternion.hx",77,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_102_get,"kha.math.Quaternion","get",0xc0271802,"kha.math.Quaternion.get","kha/math/Quaternion.hx",102,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_106_set,"kha.math.Quaternion","set",0xc030330e,"kha.math.Quaternion.set","kha/math/Quaternion.hx",106,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_116_get_x,"kha.math.Quaternion","get_x",0x6a1eefbb,"kha.math.Quaternion.get_x","kha/math/Quaternion.hx",116,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_120_set_x,"kha.math.Quaternion","set_x",0x52ede5c7,"kha.math.Quaternion.set_x","kha/math/Quaternion.hx",120,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_124_get_y,"kha.math.Quaternion","get_y",0x6a1eefbc,"kha.math.Quaternion.get_y","kha/math/Quaternion.hx",124,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_128_set_y,"kha.math.Quaternion","set_y",0x52ede5c8,"kha.math.Quaternion.set_y","kha/math/Quaternion.hx",128,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_132_get_z,"kha.math.Quaternion","get_z",0x6a1eefbd,"kha.math.Quaternion.get_z","kha/math/Quaternion.hx",132,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_136_set_z,"kha.math.Quaternion","set_z",0x52ede5c9,"kha.math.Quaternion.set_z","kha/math/Quaternion.hx",136,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_140_get_w,"kha.math.Quaternion","get_w",0x6a1eefba,"kha.math.Quaternion.get_w","kha/math/Quaternion.hx",140,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_144_set_w,"kha.math.Quaternion","set_w",0x52ede5c6,"kha.math.Quaternion.set_w","kha/math/Quaternion.hx",144,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_149_get_length,"kha.math.Quaternion","get_length",0xdd4f72c3,"kha.math.Quaternion.get_length","kha/math/Quaternion.hx",149,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_152_set_length,"kha.math.Quaternion","set_length",0xe0cd1137,"kha.math.Quaternion.set_length","kha/math/Quaternion.hx",152,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_162_addVector,"kha.math.Quaternion","addVector",0x3573d630,"kha.math.Quaternion.addVector","kha/math/Quaternion.hx",162,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_176_add,"kha.math.Quaternion","add",0xc022898d,"kha.math.Quaternion.add","kha/math/Quaternion.hx",176,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_180_sub,"kha.math.Quaternion","sub",0xc03040ec,"kha.math.Quaternion.sub","kha/math/Quaternion.hx",180,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_184_mult,"kha.math.Quaternion","mult",0x66114f04,"kha.math.Quaternion.mult","kha/math/Quaternion.hx",184,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_194_normalize,"kha.math.Quaternion","normalize",0x919327f9,"kha.math.Quaternion.normalize","kha/math/Quaternion.hx",194,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_198_dot,"kha.math.Quaternion","dot",0xc024d9f5,"kha.math.Quaternion.dot","kha/math/Quaternion.hx",198,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_214_getEulerAngles,"kha.math.Quaternion","getEulerAngles",0xb1f632a7,"kha.math.Quaternion.getEulerAngles","kha/math/Quaternion.hx",214,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_19_fromAxisAngle,"kha.math.Quaternion","fromAxisAngle",0x7d600314,"kha.math.Quaternion.fromAxisAngle","kha/math/Quaternion.hx",19,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_210_boot,"kha.math.Quaternion","boot",0x5ec76b46,"kha.math.Quaternion.boot","kha/math/Quaternion.hx",210,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_211_boot,"kha.math.Quaternion","boot",0x5ec76b46,"kha.math.Quaternion.boot","kha/math/Quaternion.hx",211,0x3ed4fcc4)
HX_LOCAL_STACK_FRAME(_hx_pos_002fcb5d014f4211_212_boot,"kha.math.Quaternion","boot",0x5ec76b46,"kha.math.Quaternion.boot","kha/math/Quaternion.hx",212,0x3ed4fcc4)
namespace kha{
namespace math{
void Quaternion_obj::__construct(hx::Null< Float > __o_x,hx::Null< Float > __o_y,hx::Null< Float > __o_z,hx::Null< Float > __o_w){
Float x = __o_x.Default(0);
Float y = __o_y.Default(0);
Float z = __o_z.Default(0);
Float w = __o_w.Default(1);
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_10_new)
HXLINE( 11) this->values = ::Array_obj< Float >::__new();
HXLINE( 12) this->values->push(x);
HXLINE( 13) this->values->push(y);
HXLINE( 14) this->values->push(z);
HXLINE( 15) this->values->push(w);
}
Dynamic Quaternion_obj::__CreateEmpty() { return new Quaternion_obj; }
void *Quaternion_obj::_hx_vtable = 0;
Dynamic Quaternion_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< Quaternion_obj > _hx_result = new Quaternion_obj();
_hx_result->__construct(inArgs[0],inArgs[1],inArgs[2],inArgs[3]);
return _hx_result;
}
bool Quaternion_obj::_hx_isInstanceOf(int inClassId) {
return inClassId==(int)0x00000001 || inClassId==(int)0x153119aa;
}
::kha::math::Quaternion Quaternion_obj::slerp(Float t, ::kha::math::Quaternion q){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_29_slerp)
HXLINE( 30) Float epsilon = ((Float)0.0005);
HXLINE( 32) Float dot = this->dot(q);
HXLINE( 34) if ((dot > ((int)1 - epsilon))) {
HXLINE( 35) ::kha::math::Quaternion result = q->add(this->sub(q)->scaled(t));
HXLINE( 36) result->normalize();
HXLINE( 37) return result;
}
HXLINE( 39) if ((dot < (int)0)) {
HXLINE( 39) dot = (int)0;
}
HXLINE( 40) if ((dot > (int)1)) {
HXLINE( 40) dot = (int)1;
}
HXLINE( 42) Float theta0 = ::Math_obj::acos(dot);
HXLINE( 43) Float theta = (theta0 * t);
HXLINE( 45) ::kha::math::Quaternion q2 = q->sub(this->scaled(dot));
HXLINE( 46) q2->normalize();
HXLINE( 48) ::kha::math::Quaternion result1 = this->scaled(::Math_obj::cos(theta));
HXDLIN( 48) ::kha::math::Quaternion result2 = result1->add(q2->scaled(::Math_obj::sin(theta)));
HXLINE( 50) result2->normalize();
HXLINE( 52) return result2;
}
HX_DEFINE_DYNAMIC_FUNC2(Quaternion_obj,slerp,return )
::kha::math::Quaternion Quaternion_obj::rotated( ::kha::math::Quaternion b){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_56_rotated)
HXLINE( 57) ::kha::math::Quaternion q = ::kha::math::Quaternion_obj::__alloc( HX_CTX ,null(),null(),null(),null());
HXLINE( 58) Float _hx_tmp = this->get_w();
HXDLIN( 58) Float _hx_tmp1 = (_hx_tmp * b->get_w());
HXDLIN( 58) Float _hx_tmp2 = this->get_x();
HXDLIN( 58) Float _hx_tmp3 = (_hx_tmp1 - (_hx_tmp2 * b->get_x()));
HXDLIN( 58) Float _hx_tmp4 = this->get_y();
HXDLIN( 58) Float _hx_tmp5 = (_hx_tmp3 - (_hx_tmp4 * b->get_y()));
HXDLIN( 58) Float _hx_tmp6 = this->get_z();
HXDLIN( 58) q->set_w((_hx_tmp5 - (_hx_tmp6 * b->get_z())));
HXLINE( 59) Float _hx_tmp7 = this->get_w();
HXDLIN( 59) Float _hx_tmp8 = (_hx_tmp7 * b->get_x());
HXDLIN( 59) Float _hx_tmp9 = this->get_x();
HXDLIN( 59) Float _hx_tmp10 = (_hx_tmp8 + (_hx_tmp9 * b->get_w()));
HXDLIN( 59) Float _hx_tmp11 = this->get_y();
HXDLIN( 59) Float _hx_tmp12 = (_hx_tmp10 + (_hx_tmp11 * b->get_z()));
HXDLIN( 59) Float _hx_tmp13 = this->get_z();
HXDLIN( 59) q->set_x((_hx_tmp12 - (_hx_tmp13 * b->get_y())));
HXLINE( 60) Float _hx_tmp14 = this->get_w();
HXDLIN( 60) Float _hx_tmp15 = (_hx_tmp14 * b->get_y());
HXDLIN( 60) Float _hx_tmp16 = this->get_y();
HXDLIN( 60) Float _hx_tmp17 = (_hx_tmp15 + (_hx_tmp16 * b->get_w()));
HXDLIN( 60) Float _hx_tmp18 = this->get_z();
HXDLIN( 60) Float _hx_tmp19 = (_hx_tmp17 + (_hx_tmp18 * b->get_x()));
HXDLIN( 60) Float _hx_tmp20 = this->get_x();
HXDLIN( 60) q->set_y((_hx_tmp19 - (_hx_tmp20 * b->get_z())));
HXLINE( 61) Float _hx_tmp21 = this->get_w();
HXDLIN( 61) Float _hx_tmp22 = (_hx_tmp21 * b->get_z());
HXDLIN( 61) Float _hx_tmp23 = this->get_z();
HXDLIN( 61) Float _hx_tmp24 = (_hx_tmp22 + (_hx_tmp23 * b->get_w()));
HXDLIN( 61) Float _hx_tmp25 = this->get_x();
HXDLIN( 61) Float _hx_tmp26 = (_hx_tmp24 + (_hx_tmp25 * b->get_y()));
HXDLIN( 61) Float _hx_tmp27 = this->get_y();
HXDLIN( 61) q->set_z((_hx_tmp26 - (_hx_tmp27 * b->get_x())));
HXLINE( 62) q->normalize();
HXLINE( 63) return q;
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,rotated,return )
::kha::math::Quaternion Quaternion_obj::scaled(Float scale){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_67_scaled)
HXDLIN( 67) Float _hx_tmp = (this->get_x() * scale);
HXDLIN( 67) Float _hx_tmp1 = (this->get_y() * scale);
HXDLIN( 67) Float _hx_tmp2 = (this->get_z() * scale);
HXDLIN( 67) return ::kha::math::Quaternion_obj::__alloc( HX_CTX ,_hx_tmp,_hx_tmp1,_hx_tmp2,(this->get_w() * scale));
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,scaled,return )
void Quaternion_obj::scale(Float scale){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_70_scale)
HXLINE( 71) this->set_x((this->get_x() * scale));
HXLINE( 72) this->set_y((this->get_y() * scale));
HXLINE( 73) this->set_z((this->get_z() * scale));
HXLINE( 74) this->set_w((this->get_w() * scale));
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,scale,(void))
::kha::math::Matrix4 Quaternion_obj::matrix(){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_77_matrix)
HXLINE( 78) Float s = ((Float)2.0);
HXLINE( 80) Float xs = (this->get_x() * s);
HXLINE( 81) Float ys = (this->get_y() * s);
HXLINE( 82) Float zs = (this->get_z() * s);
HXLINE( 83) Float wx = (this->get_w() * xs);
HXLINE( 84) Float wy = (this->get_w() * ys);
HXLINE( 85) Float wz = (this->get_w() * zs);
HXLINE( 86) Float xx = (this->get_x() * xs);
HXLINE( 87) Float xy = (this->get_x() * ys);
HXLINE( 88) Float xz = (this->get_x() * zs);
HXLINE( 89) Float yy = (this->get_y() * ys);
HXLINE( 90) Float yz = (this->get_y() * zs);
HXLINE( 91) Float zz = (this->get_z() * zs);
HXLINE( 93) return ::kha::math::Matrix4_obj::__alloc( HX_CTX ,((int)1 - (yy + zz)),(xy - wz),(xz + wy),(int)0,(xy + wz),((int)1 - (xx + zz)),(yz - wx),(int)0,(xz - wy),(yz + wx),((int)1 - (xx + yy)),(int)0,(int)0,(int)0,(int)0,(int)1);
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,matrix,return )
Float Quaternion_obj::get(int index){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_102_get)
HXDLIN( 102) return this->values->__get(index);
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,get,return )
void Quaternion_obj::set(int index,Float value){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_106_set)
HXDLIN( 106) this->values[index] = value;
}
HX_DEFINE_DYNAMIC_FUNC2(Quaternion_obj,set,(void))
Float Quaternion_obj::get_x(){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_116_get_x)
HXDLIN( 116) return this->values->__get((int)0);
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,get_x,return )
Float Quaternion_obj::set_x(Float value){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_120_set_x)
HXDLIN( 120) return (this->values[(int)0] = value);
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,set_x,return )
Float Quaternion_obj::get_y(){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_124_get_y)
HXDLIN( 124) return this->values->__get((int)1);
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,get_y,return )
Float Quaternion_obj::set_y(Float value){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_128_set_y)
HXDLIN( 128) return (this->values[(int)1] = value);
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,set_y,return )
Float Quaternion_obj::get_z(){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_132_get_z)
HXDLIN( 132) return this->values->__get((int)2);
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,get_z,return )
Float Quaternion_obj::set_z(Float value){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_136_set_z)
HXDLIN( 136) return (this->values[(int)2] = value);
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,set_z,return )
Float Quaternion_obj::get_w(){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_140_get_w)
HXDLIN( 140) return this->values->__get((int)3);
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,get_w,return )
Float Quaternion_obj::set_w(Float value){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_144_set_w)
HXDLIN( 144) return (this->values[(int)3] = value);
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,set_w,return )
Float Quaternion_obj::get_length(){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_149_get_length)
HXDLIN( 149) Float _hx_tmp = this->get_x();
HXDLIN( 149) Float _hx_tmp1 = (_hx_tmp * this->get_x());
HXDLIN( 149) Float _hx_tmp2 = this->get_y();
HXDLIN( 149) Float _hx_tmp3 = (_hx_tmp1 + (_hx_tmp2 * this->get_y()));
HXDLIN( 149) Float _hx_tmp4 = this->get_z();
HXDLIN( 149) Float _hx_tmp5 = (_hx_tmp3 + (_hx_tmp4 * this->get_z()));
HXDLIN( 149) Float _hx_tmp6 = this->get_w();
HXDLIN( 149) return ::Math_obj::sqrt((_hx_tmp5 + (_hx_tmp6 * this->get_w())));
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,get_length,return )
Float Quaternion_obj::set_length(Float length){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_152_set_length)
HXLINE( 153) if ((this->get_length() == (int)0)) {
HXLINE( 153) return (int)0;
}
HXLINE( 154) Float mul = ((Float)length / (Float)this->get_length());
HXLINE( 155) {
HXLINE( 155) ::kha::math::Quaternion _g = hx::ObjectPtr<OBJ_>(this);
HXDLIN( 155) _g->set_x((_g->get_x() * mul));
}
HXLINE( 156) {
HXLINE( 156) ::kha::math::Quaternion _g1 = hx::ObjectPtr<OBJ_>(this);
HXDLIN( 156) _g1->set_y((_g1->get_y() * mul));
}
HXLINE( 157) {
HXLINE( 157) ::kha::math::Quaternion _g2 = hx::ObjectPtr<OBJ_>(this);
HXDLIN( 157) _g2->set_z((_g2->get_z() * mul));
}
HXLINE( 158) return length;
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,set_length,return )
::kha::math::Quaternion Quaternion_obj::addVector( ::kha::math::Vector3 vec){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_162_addVector)
HXLINE( 163) Float result = this->get_x();
HXDLIN( 163) Float result1 = this->get_y();
HXDLIN( 163) Float result2 = this->get_z();
HXDLIN( 163) ::kha::math::Quaternion result3 = ::kha::math::Quaternion_obj::__alloc( HX_CTX ,result,result1,result2,this->get_w());
HXLINE( 164) ::kha::math::Quaternion q1 = ::kha::math::Quaternion_obj::__alloc( HX_CTX ,(int)0,vec->x,vec->y,vec->z);
HXLINE( 166) q1 = q1->mult(result3);
HXLINE( 168) {
HXLINE( 168) ::kha::math::Quaternion _g = result3;
HXDLIN( 168) Float _hx_tmp = _g->get_x();
HXDLIN( 168) _g->set_x((_hx_tmp + (q1->get_x() * ((Float)0.5))));
}
HXLINE( 169) {
HXLINE( 169) ::kha::math::Quaternion _g1 = result3;
HXDLIN( 169) Float _hx_tmp1 = _g1->get_y();
HXDLIN( 169) _g1->set_y((_hx_tmp1 + (q1->get_y() * ((Float)0.5))));
}
HXLINE( 170) {
HXLINE( 170) ::kha::math::Quaternion _g2 = result3;
HXDLIN( 170) Float _hx_tmp2 = _g2->get_z();
HXDLIN( 170) _g2->set_z((_hx_tmp2 + (q1->get_z() * ((Float)0.5))));
}
HXLINE( 171) {
HXLINE( 171) ::kha::math::Quaternion _g3 = result3;
HXDLIN( 171) Float _hx_tmp3 = _g3->get_w();
HXDLIN( 171) _g3->set_w((_hx_tmp3 + (q1->get_w() * ((Float)0.5))));
}
HXLINE( 172) return result3;
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,addVector,return )
::kha::math::Quaternion Quaternion_obj::add( ::kha::math::Quaternion q){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_176_add)
HXDLIN( 176) Float _hx_tmp = this->get_x();
HXDLIN( 176) Float _hx_tmp1 = (_hx_tmp + q->get_x());
HXDLIN( 176) Float _hx_tmp2 = this->get_y();
HXDLIN( 176) Float _hx_tmp3 = (_hx_tmp2 + q->get_y());
HXDLIN( 176) Float _hx_tmp4 = this->get_z();
HXDLIN( 176) Float _hx_tmp5 = (_hx_tmp4 + q->get_z());
HXDLIN( 176) Float _hx_tmp6 = this->get_w();
HXDLIN( 176) return ::kha::math::Quaternion_obj::__alloc( HX_CTX ,_hx_tmp1,_hx_tmp3,_hx_tmp5,(_hx_tmp6 + q->get_w()));
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,add,return )
::kha::math::Quaternion Quaternion_obj::sub( ::kha::math::Quaternion q){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_180_sub)
HXDLIN( 180) Float _hx_tmp = this->get_x();
HXDLIN( 180) Float _hx_tmp1 = (_hx_tmp - q->get_x());
HXDLIN( 180) Float _hx_tmp2 = this->get_y();
HXDLIN( 180) Float _hx_tmp3 = (_hx_tmp2 - q->get_y());
HXDLIN( 180) Float _hx_tmp4 = this->get_z();
HXDLIN( 180) Float _hx_tmp5 = (_hx_tmp4 - q->get_z());
HXDLIN( 180) Float _hx_tmp6 = this->get_w();
HXDLIN( 180) return ::kha::math::Quaternion_obj::__alloc( HX_CTX ,_hx_tmp1,_hx_tmp3,_hx_tmp5,(_hx_tmp6 - q->get_w()));
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,sub,return )
::kha::math::Quaternion Quaternion_obj::mult( ::kha::math::Quaternion r){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_184_mult)
HXLINE( 185) ::kha::math::Quaternion q = ::kha::math::Quaternion_obj::__alloc( HX_CTX ,null(),null(),null(),null());
HXLINE( 186) Float _hx_tmp = this->get_w();
HXDLIN( 186) Float _hx_tmp1 = (_hx_tmp * r->get_x());
HXDLIN( 186) Float _hx_tmp2 = this->get_x();
HXDLIN( 186) Float _hx_tmp3 = (_hx_tmp1 + (_hx_tmp2 * r->get_w()));
HXDLIN( 186) Float _hx_tmp4 = this->get_y();
HXDLIN( 186) Float _hx_tmp5 = (_hx_tmp3 + (_hx_tmp4 * r->get_z()));
HXDLIN( 186) Float _hx_tmp6 = this->get_z();
HXDLIN( 186) q->set_x((_hx_tmp5 - (_hx_tmp6 * r->get_y())));
HXLINE( 187) Float _hx_tmp7 = this->get_w();
HXDLIN( 187) Float _hx_tmp8 = (_hx_tmp7 * r->get_y());
HXDLIN( 187) Float _hx_tmp9 = this->get_x();
HXDLIN( 187) Float _hx_tmp10 = (_hx_tmp8 - (_hx_tmp9 * r->get_z()));
HXDLIN( 187) Float _hx_tmp11 = this->get_y();
HXDLIN( 187) Float _hx_tmp12 = (_hx_tmp10 + (_hx_tmp11 * r->get_w()));
HXDLIN( 187) Float _hx_tmp13 = this->get_z();
HXDLIN( 187) q->set_y((_hx_tmp12 + (_hx_tmp13 * r->get_x())));
HXLINE( 188) Float _hx_tmp14 = this->get_w();
HXDLIN( 188) Float _hx_tmp15 = (_hx_tmp14 * r->get_z());
HXDLIN( 188) Float _hx_tmp16 = this->get_x();
HXDLIN( 188) Float _hx_tmp17 = (_hx_tmp15 + (_hx_tmp16 * r->get_y()));
HXDLIN( 188) Float _hx_tmp18 = this->get_y();
HXDLIN( 188) Float _hx_tmp19 = (_hx_tmp17 - (_hx_tmp18 * r->get_x()));
HXDLIN( 188) Float _hx_tmp20 = this->get_z();
HXDLIN( 188) q->set_z((_hx_tmp19 + (_hx_tmp20 * r->get_w())));
HXLINE( 189) Float _hx_tmp21 = this->get_w();
HXDLIN( 189) Float _hx_tmp22 = (_hx_tmp21 * r->get_w());
HXDLIN( 189) Float _hx_tmp23 = this->get_x();
HXDLIN( 189) Float _hx_tmp24 = (_hx_tmp22 - (_hx_tmp23 * r->get_x()));
HXDLIN( 189) Float _hx_tmp25 = this->get_y();
HXDLIN( 189) Float _hx_tmp26 = (_hx_tmp24 - (_hx_tmp25 * r->get_y()));
HXDLIN( 189) Float _hx_tmp27 = this->get_z();
HXDLIN( 189) q->set_w((_hx_tmp26 - (_hx_tmp27 * r->get_z())));
HXLINE( 190) return q;
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,mult,return )
void Quaternion_obj::normalize(){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_194_normalize)
HXDLIN( 194) this->scale(((Float)((Float)1.0) / (Float)this->get_length()));
}
HX_DEFINE_DYNAMIC_FUNC0(Quaternion_obj,normalize,(void))
Float Quaternion_obj::dot( ::kha::math::Quaternion q){
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_198_dot)
HXDLIN( 198) Float _hx_tmp = this->get_x();
HXDLIN( 198) Float _hx_tmp1 = (_hx_tmp * q->get_x());
HXDLIN( 198) Float _hx_tmp2 = this->get_y();
HXDLIN( 198) Float _hx_tmp3 = (_hx_tmp1 + (_hx_tmp2 * q->get_y()));
HXDLIN( 198) Float _hx_tmp4 = this->get_z();
HXDLIN( 198) Float _hx_tmp5 = (_hx_tmp3 + (_hx_tmp4 * q->get_z()));
HXDLIN( 198) Float _hx_tmp6 = this->get_w();
HXDLIN( 198) return (_hx_tmp5 + (_hx_tmp6 * q->get_w()));
}
HX_DEFINE_DYNAMIC_FUNC1(Quaternion_obj,dot,return )
::kha::math::Vector3 Quaternion_obj::getEulerAngles(int A1,int A2,int A3,hx::Null< int > __o_S,hx::Null< int > __o_D){
int S = __o_S.Default(1);
int D = __o_D.Default(1);
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_214_getEulerAngles)
HXLINE( 215) ::kha::math::Vector3 result = ::kha::math::Vector3_obj::__alloc( HX_CTX ,null(),null(),null());
HXLINE( 217) ::Array< Float > Q = ::Array_obj< Float >::__new();
HXLINE( 218) Q[(int)0] = this->get_x();
HXLINE( 219) Q[(int)1] = this->get_y();
HXLINE( 220) Q[(int)2] = this->get_z();
HXLINE( 222) Float ww = this->get_w();
HXDLIN( 222) Float ww1 = (ww * this->get_w());
HXLINE( 224) Float Q11 = (Q->__get(A1) * Q->__get(A1));
HXLINE( 225) Float Q22 = (Q->__get(A2) * Q->__get(A2));
HXLINE( 226) Float Q33 = (Q->__get(A3) * Q->__get(A3));
HXLINE( 228) Float psign = (int)-1;
HXLINE( 230) Float SingularityRadius = ((Float)0.0000001);
HXLINE( 231) Float PiOver2 = ((Float)::Math_obj::PI / (Float)((Float)2.0));
HXLINE( 234) bool _hx_tmp;
HXDLIN( 234) if ((hx::Mod((A1 + (int)1),(int)3) == A2)) {
HXLINE( 234) _hx_tmp = (hx::Mod((A2 + (int)1),(int)3) == A3);
}
else {
HXLINE( 234) _hx_tmp = false;
}
HXDLIN( 234) if (_hx_tmp) {
HXLINE( 235) psign = (int)1;
}
HXLINE( 238) Float s2 = (psign * this->get_w());
HXDLIN( 238) Float s21 = (s2 * Q->__get(A2));
HXDLIN( 238) Float s22 = ((psign * ((Float)2.0)) * (s21 + (Q->__get(A1) * Q->__get(A3))));
HXLINE( 240) if ((s22 < ((int)-1 + SingularityRadius))) {
HXLINE( 241) result->x = (int)0;
HXLINE( 242) result->y = ((-(S) * D) * PiOver2);
HXLINE( 243) Float _hx_tmp1 = ((psign * Q->__get(A1)) * Q->__get(A2));
HXDLIN( 243) Float _hx_tmp2 = this->get_w();
HXDLIN( 243) Float _hx_tmp3 = ((int)2 * (_hx_tmp1 + (_hx_tmp2 * Q->__get(A3))));
HXDLIN( 243) result->z = ((S * D) * ::Math_obj::atan2(_hx_tmp3,(((ww1 + Q22) - Q11) - Q33)));
}
else {
HXLINE( 245) if ((s22 > ((int)1 - SingularityRadius))) {
HXLINE( 246) result->x = (int)0;
HXLINE( 247) result->y = ((S * D) * PiOver2);
HXLINE( 248) Float _hx_tmp4 = ((psign * Q->__get(A1)) * Q->__get(A2));
HXDLIN( 248) Float _hx_tmp5 = this->get_w();
HXDLIN( 248) Float _hx_tmp6 = ((int)2 * (_hx_tmp4 + (_hx_tmp5 * Q->__get(A3))));
HXDLIN( 248) result->z = ((S * D) * ::Math_obj::atan2(_hx_tmp6,(((ww1 + Q22) - Q11) - Q33)));
}
else {
HXLINE( 251) Float _hx_tmp7 = this->get_w();
HXDLIN( 251) Float _hx_tmp8 = (_hx_tmp7 * Q->__get(A1));
HXDLIN( 251) Float _hx_tmp9 = ((int)-2 * (_hx_tmp8 - ((psign * Q->__get(A2)) * Q->__get(A3))));
HXDLIN( 251) result->x = ((-(S) * D) * ::Math_obj::atan2(_hx_tmp9,(((ww1 + Q33) - Q11) - Q22)));
HXLINE( 252) result->y = ((S * D) * ::Math_obj::asin(s22));
HXLINE( 253) Float _hx_tmp10 = this->get_w();
HXDLIN( 253) Float _hx_tmp11 = (_hx_tmp10 * Q->__get(A3));
HXDLIN( 253) Float _hx_tmp12 = ((int)2 * (_hx_tmp11 - ((psign * Q->__get(A1)) * Q->__get(A2))));
HXDLIN( 253) result->z = ((S * D) * ::Math_obj::atan2(_hx_tmp12,(((ww1 + Q11) - Q22) - Q33)));
}
}
HXLINE( 256) return result;
}
HX_DEFINE_DYNAMIC_FUNC5(Quaternion_obj,getEulerAngles,return )
::kha::math::Quaternion Quaternion_obj::fromAxisAngle( ::kha::math::Vector3 axis,Float radians){
HX_GC_STACKFRAME(&_hx_pos_002fcb5d014f4211_19_fromAxisAngle)
HXLINE( 20) ::kha::math::Quaternion q = ::kha::math::Quaternion_obj::__alloc( HX_CTX ,null(),null(),null(),null());
HXLINE( 21) q->set_w(::Math_obj::cos(((Float)radians / (Float)((Float)2.0))));
HXLINE( 22) q->set_x(q->set_y(q->set_z(::Math_obj::sin(((Float)radians / (Float)((Float)2.0))))));
HXLINE( 23) {
HXLINE( 23) ::kha::math::Quaternion _g = q;
HXDLIN( 23) Float _hx_tmp = _g->get_x();
HXDLIN( 23) _g->set_x((_hx_tmp * axis->x));
}
HXLINE( 24) {
HXLINE( 24) ::kha::math::Quaternion _g1 = q;
HXDLIN( 24) Float _hx_tmp1 = _g1->get_y();
HXDLIN( 24) _g1->set_y((_hx_tmp1 * axis->y));
}
HXLINE( 25) {
HXLINE( 25) ::kha::math::Quaternion _g2 = q;
HXDLIN( 25) Float _hx_tmp2 = _g2->get_z();
HXDLIN( 25) _g2->set_z((_hx_tmp2 * axis->z));
}
HXLINE( 26) return q;
}
STATIC_HX_DEFINE_DYNAMIC_FUNC2(Quaternion_obj,fromAxisAngle,return )
int Quaternion_obj::AXIS_X;
int Quaternion_obj::AXIS_Y;
int Quaternion_obj::AXIS_Z;
hx::ObjectPtr< Quaternion_obj > Quaternion_obj::__new(hx::Null< Float > __o_x,hx::Null< Float > __o_y,hx::Null< Float > __o_z,hx::Null< Float > __o_w) {
hx::ObjectPtr< Quaternion_obj > __this = new Quaternion_obj();
__this->__construct(__o_x,__o_y,__o_z,__o_w);
return __this;
}
hx::ObjectPtr< Quaternion_obj > Quaternion_obj::__alloc(hx::Ctx *_hx_ctx,hx::Null< Float > __o_x,hx::Null< Float > __o_y,hx::Null< Float > __o_z,hx::Null< Float > __o_w) {
Quaternion_obj *__this = (Quaternion_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(Quaternion_obj), true, "kha.math.Quaternion"));
*(void **)__this = Quaternion_obj::_hx_vtable;
__this->__construct(__o_x,__o_y,__o_z,__o_w);
return __this;
}
Quaternion_obj::Quaternion_obj()
{
}
void Quaternion_obj::__Mark(HX_MARK_PARAMS)
{
HX_MARK_BEGIN_CLASS(Quaternion);
HX_MARK_MEMBER_NAME(values,"values");
HX_MARK_END_CLASS();
}
void Quaternion_obj::__Visit(HX_VISIT_PARAMS)
{
HX_VISIT_MEMBER_NAME(values,"values");
}
hx::Val Quaternion_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 1:
if (HX_FIELD_EQ(inName,"x") ) { if (inCallProp == hx::paccAlways) return hx::Val( get_x() ); }
if (HX_FIELD_EQ(inName,"y") ) { if (inCallProp == hx::paccAlways) return hx::Val( get_y() ); }
if (HX_FIELD_EQ(inName,"z") ) { if (inCallProp == hx::paccAlways) return hx::Val( get_z() ); }
if (HX_FIELD_EQ(inName,"w") ) { if (inCallProp == hx::paccAlways) return hx::Val( get_w() ); }
break;
case 3:
if (HX_FIELD_EQ(inName,"get") ) { return hx::Val( get_dyn() ); }
if (HX_FIELD_EQ(inName,"set") ) { return hx::Val( set_dyn() ); }
if (HX_FIELD_EQ(inName,"add") ) { return hx::Val( add_dyn() ); }
if (HX_FIELD_EQ(inName,"sub") ) { return hx::Val( sub_dyn() ); }
if (HX_FIELD_EQ(inName,"dot") ) { return hx::Val( dot_dyn() ); }
break;
case 4:
if (HX_FIELD_EQ(inName,"mult") ) { return hx::Val( mult_dyn() ); }
break;
case 5:
if (HX_FIELD_EQ(inName,"slerp") ) { return hx::Val( slerp_dyn() ); }
if (HX_FIELD_EQ(inName,"scale") ) { return hx::Val( scale_dyn() ); }
if (HX_FIELD_EQ(inName,"get_x") ) { return hx::Val( get_x_dyn() ); }
if (HX_FIELD_EQ(inName,"set_x") ) { return hx::Val( set_x_dyn() ); }
if (HX_FIELD_EQ(inName,"get_y") ) { return hx::Val( get_y_dyn() ); }
if (HX_FIELD_EQ(inName,"set_y") ) { return hx::Val( set_y_dyn() ); }
if (HX_FIELD_EQ(inName,"get_z") ) { return hx::Val( get_z_dyn() ); }
if (HX_FIELD_EQ(inName,"set_z") ) { return hx::Val( set_z_dyn() ); }
if (HX_FIELD_EQ(inName,"get_w") ) { return hx::Val( get_w_dyn() ); }
if (HX_FIELD_EQ(inName,"set_w") ) { return hx::Val( set_w_dyn() ); }
break;
case 6:
if (HX_FIELD_EQ(inName,"values") ) { return hx::Val( values ); }
if (HX_FIELD_EQ(inName,"scaled") ) { return hx::Val( scaled_dyn() ); }
if (HX_FIELD_EQ(inName,"matrix") ) { return hx::Val( matrix_dyn() ); }
if (HX_FIELD_EQ(inName,"length") ) { if (inCallProp == hx::paccAlways) return hx::Val( get_length() ); }
break;
case 7:
if (HX_FIELD_EQ(inName,"rotated") ) { return hx::Val( rotated_dyn() ); }
break;
case 9:
if (HX_FIELD_EQ(inName,"addVector") ) { return hx::Val( addVector_dyn() ); }
if (HX_FIELD_EQ(inName,"normalize") ) { return hx::Val( normalize_dyn() ); }
break;
case 10:
if (HX_FIELD_EQ(inName,"get_length") ) { return hx::Val( get_length_dyn() ); }
if (HX_FIELD_EQ(inName,"set_length") ) { return hx::Val( set_length_dyn() ); }
break;
case 14:
if (HX_FIELD_EQ(inName,"getEulerAngles") ) { return hx::Val( getEulerAngles_dyn() ); }
}
return super::__Field(inName,inCallProp);
}
bool Quaternion_obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 13:
if (HX_FIELD_EQ(inName,"fromAxisAngle") ) { outValue = fromAxisAngle_dyn(); return true; }
}
return false;
}
hx::Val Quaternion_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 1:
if (HX_FIELD_EQ(inName,"x") ) { if (inCallProp == hx::paccAlways) return hx::Val( set_x(inValue.Cast< Float >()) ); }
if (HX_FIELD_EQ(inName,"y") ) { if (inCallProp == hx::paccAlways) return hx::Val( set_y(inValue.Cast< Float >()) ); }
if (HX_FIELD_EQ(inName,"z") ) { if (inCallProp == hx::paccAlways) return hx::Val( set_z(inValue.Cast< Float >()) ); }
if (HX_FIELD_EQ(inName,"w") ) { if (inCallProp == hx::paccAlways) return hx::Val( set_w(inValue.Cast< Float >()) ); }
break;
case 6:
if (HX_FIELD_EQ(inName,"values") ) { values=inValue.Cast< ::Array< Float > >(); return inValue; }
if (HX_FIELD_EQ(inName,"length") ) { if (inCallProp == hx::paccAlways) return hx::Val( set_length(inValue.Cast< Float >()) ); }
}
return super::__SetField(inName,inValue,inCallProp);
}
void Quaternion_obj::__GetFields(Array< ::String> &outFields)
{
outFields->push(HX_HCSTRING("values","\xe2","\x03","\xb7","\x4f"));
outFields->push(HX_HCSTRING("x","\x78","\x00","\x00","\x00"));
outFields->push(HX_HCSTRING("y","\x79","\x00","\x00","\x00"));
outFields->push(HX_HCSTRING("z","\x7a","\x00","\x00","\x00"));
outFields->push(HX_HCSTRING("w","\x77","\x00","\x00","\x00"));
outFields->push(HX_HCSTRING("length","\xe6","\x94","\x07","\x9f"));
super::__GetFields(outFields);
};
#if HXCPP_SCRIPTABLE
static hx::StorageInfo Quaternion_obj_sMemberStorageInfo[] = {
{hx::fsObject /*Array< Float >*/ ,(int)offsetof(Quaternion_obj,values),HX_HCSTRING("values","\xe2","\x03","\xb7","\x4f")},
{ hx::fsUnknown, 0, null()}
};
static hx::StaticInfo Quaternion_obj_sStaticStorageInfo[] = {
{hx::fsInt,(void *) &Quaternion_obj::AXIS_X,HX_HCSTRING("AXIS_X","\xfa","\x61","\xf5","\xd8")},
{hx::fsInt,(void *) &Quaternion_obj::AXIS_Y,HX_HCSTRING("AXIS_Y","\xfb","\x61","\xf5","\xd8")},
{hx::fsInt,(void *) &Quaternion_obj::AXIS_Z,HX_HCSTRING("AXIS_Z","\xfc","\x61","\xf5","\xd8")},
{ hx::fsUnknown, 0, null()}
};
#endif
static ::String Quaternion_obj_sMemberFields[] = {
HX_HCSTRING("values","\xe2","\x03","\xb7","\x4f"),
HX_HCSTRING("slerp","\x6a","\xc8","\xc4","\x7e"),
HX_HCSTRING("rotated","\xa9","\x49","\x1d","\xf1"),
HX_HCSTRING("scaled","\x9a","\xea","\x25","\x3c"),
HX_HCSTRING("scale","\x8a","\xce","\xce","\x78"),
HX_HCSTRING("matrix","\x41","\x36","\xc8","\xbb"),
HX_HCSTRING("get","\x96","\x80","\x4e","\x00"),
HX_HCSTRING("set","\xa2","\x9b","\x57","\x00"),
HX_HCSTRING("get_x","\x4f","\xa5","\x60","\x91"),
HX_HCSTRING("set_x","\x5b","\x9b","\x2f","\x7a"),
HX_HCSTRING("get_y","\x50","\xa5","\x60","\x91"),
HX_HCSTRING("set_y","\x5c","\x9b","\x2f","\x7a"),
HX_HCSTRING("get_z","\x51","\xa5","\x60","\x91"),
HX_HCSTRING("set_z","\x5d","\x9b","\x2f","\x7a"),
HX_HCSTRING("get_w","\x4e","\xa5","\x60","\x91"),
HX_HCSTRING("set_w","\x5a","\x9b","\x2f","\x7a"),
HX_HCSTRING("get_length","\xaf","\x04","\x8f","\x8f"),
HX_HCSTRING("set_length","\x23","\xa3","\x0c","\x93"),
HX_HCSTRING("addVector","\xc4","\xe5","\x81","\x4f"),
HX_HCSTRING("add","\x21","\xf2","\x49","\x00"),
HX_HCSTRING("sub","\x80","\xa9","\x57","\x00"),
HX_HCSTRING("mult","\xf0","\x67","\x65","\x48"),
HX_HCSTRING("normalize","\x8d","\x37","\xa1","\xab"),
HX_HCSTRING("dot","\x89","\x42","\x4c","\x00"),
HX_HCSTRING("getEulerAngles","\x93","\x2a","\x63","\xec"),
::String(null()) };
static void Quaternion_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(Quaternion_obj::__mClass,"__mClass");
HX_MARK_MEMBER_NAME(Quaternion_obj::AXIS_X,"AXIS_X");
HX_MARK_MEMBER_NAME(Quaternion_obj::AXIS_Y,"AXIS_Y");
HX_MARK_MEMBER_NAME(Quaternion_obj::AXIS_Z,"AXIS_Z");
};
#ifdef HXCPP_VISIT_ALLOCS
static void Quaternion_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(Quaternion_obj::__mClass,"__mClass");
HX_VISIT_MEMBER_NAME(Quaternion_obj::AXIS_X,"AXIS_X");
HX_VISIT_MEMBER_NAME(Quaternion_obj::AXIS_Y,"AXIS_Y");
HX_VISIT_MEMBER_NAME(Quaternion_obj::AXIS_Z,"AXIS_Z");
};
#endif
hx::Class Quaternion_obj::__mClass;
static ::String Quaternion_obj_sStaticFields[] = {
HX_HCSTRING("fromAxisAngle","\xa8","\x6c","\x6f","\xf0"),
HX_HCSTRING("AXIS_X","\xfa","\x61","\xf5","\xd8"),
HX_HCSTRING("AXIS_Y","\xfb","\x61","\xf5","\xd8"),
HX_HCSTRING("AXIS_Z","\xfc","\x61","\xf5","\xd8"),
::String(null())
};
void Quaternion_obj::__register()
{
hx::Object *dummy = new Quaternion_obj;
Quaternion_obj::_hx_vtable = *(void **)dummy;
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_HCSTRING("kha.math.Quaternion","\xda","\xd1","\x59","\xbc");
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &Quaternion_obj::__GetStatic;
__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
__mClass->mMarkFunc = Quaternion_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(Quaternion_obj_sStaticFields);
__mClass->mMembers = hx::Class_obj::dupFunctions(Quaternion_obj_sMemberFields);
__mClass->mCanCast = hx::TCanCast< Quaternion_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = Quaternion_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = Quaternion_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = Quaternion_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
void Quaternion_obj::__boot()
{
{
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_210_boot)
HXDLIN( 210) AXIS_X = (int)0;
}
{
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_211_boot)
HXDLIN( 211) AXIS_Y = (int)1;
}
{
HX_STACKFRAME(&_hx_pos_002fcb5d014f4211_212_boot)
HXDLIN( 212) AXIS_Z = (int)2;
}
}
} // end namespace kha
} // end namespace math
| [
"neverliberty@gmail.com"
] | neverliberty@gmail.com |
f9fdd3eaeb207ea4382204ed1fdc2cb1d68d2b17 | c6392d2e028a1671c7527b05d2596c13b37d2e83 | /hhvm-3.2-include/hphp/third-party/folly/Uri.h | 5e7653092f4c716c1a23be166d80bc16e9397844 | [
"PHP-3.01"
] | permissive | sandeepone/hhvm_ext_pcurl | 7a47ced0b54639c8c9b1dfb820a55cd0e03aaccf | d445f6b47c66e646e039a71d8e22860a5831e0a6 | refs/heads/master | 2021-01-15T17:51:32.224760 | 2015-04-21T15:49:37 | 2015-04-21T15:49:37 | 42,769,830 | 2 | 0 | null | 2015-09-19T11:05:17 | 2015-09-19T11:05:17 | null | UTF-8 | C++ | false | false | 2,961 | h | /*
* Copyright 2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FOLLY_URI_H_
#define FOLLY_URI_H_
#include "folly/String.h"
namespace folly {
/**
* Class representing a URI.
*
* Consider http://www.facebook.com/foo/bar?key=foo#anchor
*
* The URI is broken down into its parts: scheme ("http"), authority
* (ie. host and port, in most cases: "www.facebook.com"), path
* ("/foo/bar"), query ("key=foo") and fragment ("anchor"). The scheme is
* lower-cased.
*
* If this Uri represents a URL, note that, to prevent ambiguity, the component
* parts are NOT percent-decoded; you should do this yourself with
* uriUnescape() (for the authority and path) and uriUnescape(...,
* UriEscapeMode::QUERY) (for the query, but probably only after splitting at
* '&' to identify the individual parameters).
*/
class Uri {
public:
/**
* Parse a Uri from a string. Throws std::invalid_argument on parse error.
*/
explicit Uri(StringPiece str);
const fbstring& scheme() const { return scheme_; }
const fbstring& username() const { return username_; }
const fbstring& password() const { return password_; }
/**
* Get host part of URI. If host is an IPv6 address, square brackets will be
* returned, for example: "[::1]".
*/
const fbstring& host() const { return host_; }
/**
* Get host part of URI. If host is an IPv6 address, square brackets will not
* be returned, for exmaple "::1"; otherwise it returns the same thing as
* host().
*
* hostname() is what one needs to call if passing the host to any other tool
* or API that connects to that host/port; e.g. getaddrinfo() only understands
* IPv6 host without square brackets
*/
fbstring hostname() const;
uint16_t port() const { return port_; }
const fbstring& path() const { return path_; }
const fbstring& query() const { return query_; }
const fbstring& fragment() const { return fragment_; }
fbstring authority() const;
template <class String>
String toString() const;
std::string str() const { return toString<std::string>(); }
fbstring fbstr() const { return toString<fbstring>(); }
void setPort(uint16_t port) {port_ = port;}
private:
fbstring scheme_;
fbstring username_;
fbstring password_;
fbstring host_;
uint16_t port_;
fbstring path_;
fbstring query_;
fbstring fragment_;
};
} // namespace folly
#include "folly/Uri-inl.h"
#endif /* FOLLY_URI_H_ */
| [
"adriang@gmx.net"
] | adriang@gmx.net |
42b92e00e4f5026dc2e00b06c2ec5dabbfe0b6ba | 49f88ff91aa582e1a9d5ae5a7014f5c07eab7503 | /gen/third_party/blink/renderer/bindings/core/v8/v8_xml_document.cc | b46ed8383198e68673c13b8366a7201fe84a15db | [] | no_license | AoEiuV020/kiwibrowser-arm64 | b6c719b5f35d65906ae08503ec32f6775c9bb048 | ae7383776e0978b945e85e54242b4e3f7b930284 | refs/heads/main | 2023-06-01T21:09:33.928929 | 2021-06-22T15:56:53 | 2021-06-22T15:56:53 | 379,186,747 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,206 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated from the Jinja2 template
// third_party/blink/renderer/bindings/templates/interface.cpp.tmpl
// by the script code_generator_v8.py.
// DO NOT MODIFY!
// clang-format off
#include "third_party/blink/renderer/bindings/core/v8/v8_xml_document.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/bindings/core/v8/exception_state.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_location.h"
#include "third_party/blink/renderer/core/animation/document_animation.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/fullscreen/document_fullscreen.h"
#include "third_party/blink/renderer/core/svg/svg_document_extensions.h"
#include "third_party/blink/renderer/core/xml/document_xpath_evaluator.h"
#include "third_party/blink/renderer/platform/bindings/runtime_call_stats.h"
#include "third_party/blink/renderer/platform/bindings/v8_object_constructor.h"
#include "third_party/blink/renderer/platform/wtf/get_ptr.h"
namespace blink {
// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
const WrapperTypeInfo V8XMLDocument::wrapperTypeInfo = {
gin::kEmbedderBlink,
V8XMLDocument::domTemplate,
nullptr,
"XMLDocument",
&V8Document::wrapperTypeInfo,
WrapperTypeInfo::kWrapperTypeObjectPrototype,
WrapperTypeInfo::kNodeClassId,
WrapperTypeInfo::kNotInheritFromActiveScriptWrappable,
};
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic pop
#endif
// This static member must be declared by DEFINE_WRAPPERTYPEINFO in XMLDocument.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// platform/bindings/ScriptWrappable.h.
const WrapperTypeInfo& XMLDocument::wrapper_type_info_ = V8XMLDocument::wrapperTypeInfo;
// not [ActiveScriptWrappable]
static_assert(
!std::is_base_of<ActiveScriptWrappableBase, XMLDocument>::value,
"XMLDocument inherits from ActiveScriptWrappable<>, but is not specifying "
"[ActiveScriptWrappable] extended attribute in the IDL file. "
"Be consistent.");
static_assert(
std::is_same<decltype(&XMLDocument::HasPendingActivity),
decltype(&ScriptWrappable::HasPendingActivity)>::value,
"XMLDocument is overriding hasPendingActivity(), but is not specifying "
"[ActiveScriptWrappable] extended attribute in the IDL file. "
"Be consistent.");
namespace XMLDocumentV8Internal {
static void locationAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
XMLDocument* impl = V8XMLDocument::ToImpl(holder);
V8SetReturnValueFast(info, WTF::GetPtr(impl->location()), impl);
}
static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
// [PutForwards] => location.href
ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "XMLDocument", "location");
v8::Local<v8::Value> target;
if (!holder->Get(isolate->GetCurrentContext(), V8AtomicString(isolate, "location")).ToLocal(&target))
return;
if (!target->IsObject()) {
exceptionState.ThrowTypeError("The attribute value is not an object");
return;
}
bool result;
if (!target.As<v8::Object>()->Set(isolate->GetCurrentContext(), V8AtomicString(isolate, "href"), v8Value).To(&result))
return;
if (!result)
return;
}
} // namespace XMLDocumentV8Internal
void V8XMLDocument::locationAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_XMLDocument_location_Getter");
XMLDocumentV8Internal::locationAttributeGetter(info);
}
void V8XMLDocument::locationAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_XMLDocument_location_Setter");
v8::Local<v8::Value> v8Value = info[0];
XMLDocumentV8Internal::locationAttributeSetter(v8Value, info);
}
static const V8DOMConfiguration::AccessorConfiguration V8XMLDocumentAccessors[] = {
{ "location", V8XMLDocument::locationAttributeGetterCallback, V8XMLDocument::locationAttributeSetterCallback, V8PrivateProperty::kNoCachedAccessor, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kHasNoSideEffect, V8DOMConfiguration::kAllWorlds },
};
static void installV8XMLDocumentTemplate(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::FunctionTemplate> interfaceTemplate) {
// Initialize the interface object's template.
V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8XMLDocument::wrapperTypeInfo.interface_name, V8Document::domTemplate(isolate, world), V8XMLDocument::internalFieldCount);
v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
ALLOW_UNUSED_LOCAL(signature);
v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
ALLOW_UNUSED_LOCAL(instanceTemplate);
v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
ALLOW_UNUSED_LOCAL(prototypeTemplate);
// Register IDL constants, attributes and operations.
V8DOMConfiguration::InstallAccessors(
isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate,
signature, V8XMLDocumentAccessors, arraysize(V8XMLDocumentAccessors));
// Custom signature
V8XMLDocument::InstallRuntimeEnabledFeaturesOnTemplate(
isolate, world, interfaceTemplate);
}
void V8XMLDocument::InstallRuntimeEnabledFeaturesOnTemplate(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::FunctionTemplate> interface_template) {
v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interface_template);
ALLOW_UNUSED_LOCAL(signature);
v8::Local<v8::ObjectTemplate> instance_template = interface_template->InstanceTemplate();
ALLOW_UNUSED_LOCAL(instance_template);
v8::Local<v8::ObjectTemplate> prototype_template = interface_template->PrototypeTemplate();
ALLOW_UNUSED_LOCAL(prototype_template);
// Register IDL constants, attributes and operations.
// Custom signature
}
v8::Local<v8::FunctionTemplate> V8XMLDocument::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
return V8DOMConfiguration::DomClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8XMLDocumentTemplate);
}
bool V8XMLDocument::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
return V8PerIsolateData::From(isolate)->HasInstance(&wrapperTypeInfo, v8Value);
}
v8::Local<v8::Object> V8XMLDocument::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
return V8PerIsolateData::From(isolate)->FindInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}
XMLDocument* V8XMLDocument::ToImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) {
return hasInstance(value, isolate) ? ToImpl(v8::Local<v8::Object>::Cast(value)) : nullptr;
}
XMLDocument* NativeValueTraits<XMLDocument>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
XMLDocument* nativeValue = V8XMLDocument::ToImplWithTypeCheck(isolate, value);
if (!nativeValue) {
exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue(
"XMLDocument"));
}
return nativeValue;
}
} // namespace blink
| [
"aoeiuv020@gmail.com"
] | aoeiuv020@gmail.com |
846e0e80c1152ddd26ffef99827ffaf6a4731677 | 3ca7dd1e368194aa2f884139d01f802073cbbe0d | /Codeforces/solved/1343B/1343B.cpp | 22b5c64afcd9a9f523381508655ce2bfe78e189d | [] | no_license | callistusystan/Algorithms-and-Data-Structures | 07fd1a87ff3cfb07326f9f18513386a575359447 | 560e860ca1e546b7e7930d4e1bf2dd7c3acbcbc5 | refs/heads/master | 2023-02-17T17:29:21.678463 | 2023-02-11T09:12:40 | 2023-02-11T09:12:40 | 113,574,821 | 8 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 677 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int T; cin >> T;
while (T--) {
int N; cin >> N;
if ((N/2)%2) cout << "NO\n";
else {
cout << "YES\n";
// 2, 4, 6, 8
int n = N/2;
int sum_even = 0;
for (int i=0;i<n;i++) {
int x = 2*(i+1);
cout << x << " ";
sum_even += x;
}
int sum_odd = 0;
for (int i=0;i+1<n;i++) {
int x = 2*(i+1)-1;
cout << x << " ";
sum_odd += x;
}
cout << sum_even - sum_odd << endl;
}
}
return 0;
}
| [
"callistusystan@gmail.com"
] | callistusystan@gmail.com |
bb64ac8030f435ce50e5690e6053b03beeb7070f | a9c2e8af294433d02c790d2c94a31a88ed0b525f | /stl/stldebug.h | 7377f7578317303a05ee911ba499373f339c77ef | [
"MIT"
] | permissive | willywood/ObjectFile | fbcd6521186ae5c75386c3e6154e9d157e48971c | 84a1553b98a5300c4fc68087bf8a2a4884680e64 | refs/heads/master | 2021-12-03T05:43:39.266392 | 2019-12-14T20:45:19 | 2019-12-14T20:45:19 | 95,361,898 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 11,997 | h | /*
*
* Copyright (c) 1997
* Moscow Center for SPARC Technology
*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
#ifndef __STLPORT_DEBUG_H
# define __STLPORT_DEBUG_H
# if defined (__STL_ASSERTIONS) || defined (__STL_DEBUG)
#ifndef __STL_CONFIG_H
# include <stl_config.h>
#endif
# if !defined(__STL_FILE__)
# define __STL_FILE__ __FILE__
# endif
enum {
_StlFormat_ERROR_RETURN,
_StlFormat_ASSERTION_FAILURE,
_StlFormat_VERBOSE_ASSERTION_FAILURE,
_StlMsg_INVALID_ARGUMENT,
_StlMsg_INVALID_CONTAINER,
_StlMsg_EMPTY_CONTAINER,
_StlMsg_ERASE_PAST_THE_END,
_StlMsg_OUT_OF_BOUNDS,
_StlMsg_NOT_OWNER,
_StlMsg_INVALID_ITERATOR,
_StlMsg_INVALID_LEFTHAND_ITERATOR,
_StlMsg_INVALID_RIGHTHAND_ITERATOR,
_StlMsg_DIFFERENT_OWNERS ,
_StlMsg_NOT_DEREFERENCEABLE ,
_StlMsg_INVALID_RANGE ,
_StlMsg_NOT_IN_RANGE_1 ,
_StlMsg_NOT_IN_RANGE_2 ,
_StlMsg_INVALID_ADVANCE ,
_StlMsg_SINGULAR_ITERATOR ,
// debug alloc messages
_StlMsg_DBA_DELETED_TWICE ,
_StlMsg_DBA_NEVER_ALLOCATED ,
_StlMsg_DBA_TYPE_MISMATCH ,
_StlMsg_DBA_SIZE_MISMATCH ,
_StlMsg_DBA_UNDERRUN ,
_StlMsg_DBA_OVERRUN ,
_StlMsg_UNKNOWN
/* _StlMsg_MAX */
};
/* have to hardcode that ;() */
# define _StlMsg_MAX 27
__STL_BEGIN_NAMESPACE
// This class is unique (not inherited from exception),
// to disallow catch in anything but (...)
struct __stl_debug_exception {
// no members
};
class __owned_link;
class __owned_list;
template <class _Dummy>
struct __stl_debug_engine {
// Basic routine to report any debug message
// Use __STL_DEBUG_MESSAGE to override
static void _Message(const char * format_str, ...);
// Micsellanous function to report indexed error message
static void _IndexedError(int __ind, const char* __f, int __l);
// Basic assertion report mechanism.
// Reports failed assertion via __stl_debug_message and calls _Terminate
// if __STL_DEBUG_TERMINATE is specified, calls __stl_debug_terminate instead
static void _Assert(const char* __expr, const char* __f, int __l);
// The same, with additional diagnostics
static void _VerboseAssert(const char* __expr, int __error_ind, const char* __f, int __l);
// If exceptions are present, sends unique exception
// If not, calls abort() to terminate
// Use __STL_DEBUG_TERMINATE to override
static void _Terminate();
// owned_list/link delegate non-inline functions here
static bool _Check_same_owner( const __owned_link& __i1,
const __owned_link& __i2);
static bool _Check_same_owner_or_null( const __owned_link& __i1,
const __owned_link& __i2);
static bool _Check_if_owner( const __owned_list*, const __owned_link&);
static void _Verify(const __owned_list*);
static void _Swap_owners(__owned_list&, __owned_list& , bool __swap_roots);
static void _Invalidate_all(__owned_list*);
static void _M_detach(__owned_list*, __owned_link*);
static void _M_attach(__owned_list*, __owned_link*);
// debug messages and formats
static const char* _Message_table[_StlMsg_MAX];
};
// This is a hook to instantiate STLport exports in a designated DLL
# if defined (__STL_USE_DECLSPEC)
__STL_EXPORT template struct __STL_CLASS_DECLSPEC __stl_debug_engine<bool>;
# endif /* __STL_USE_DECLSPEC */
typedef __stl_debug_engine<bool> __stl_debugger;
__STL_END_NAMESPACE
# define __stl_assert(expr) \
do { if (!(expr)) { \
__STLPORT_STD::__stl_debugger::_Assert( # expr, __STL_FILE__, __LINE__); \
} \
} while (0)
# endif /* __STL_ASSERTIONS || __STL_DEBUG */
// this section is for __STL_DEBUG only
#if defined ( __STL_DEBUG )
# define __stl_verbose_assert(expr,__diag_num) \
do { if (!(expr)) { __STLPORT_STD::__stl_debug_engine<bool>::_VerboseAssert\
( # expr, __diag_num, __STL_FILE__, __LINE__ ); \
} \
} while(0)
# define __stl_debug_check __stl_assert
# define __stl_debug_do(expr) expr
#if defined(__MRC__) //*TY 01/15/1999 - MrCpp optimizer confuses on this debugging code
#pragma options opt none
#endif
# define __stl_verbose_return(__expr,__diag_num) if (!(__expr)) { \
__STLPORT_STD::__stl_debug_engine<bool>::_IndexedError(__diag_num, __FILE__ , __LINE__); \
return false; }
#if defined (__STL_THREADS) && ! defined (__SGI_STL_INTERNAL_THREADS_H)
# include <stl_threads.h>
#endif
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_H
# include <stl_iterator_base.h>
#endif
__STL_BEGIN_NAMESPACE
//=============================================================
template <class __Iterator>
inline bool __valid_range(const __Iterator& __i1 ,const __Iterator& __i2,
random_access_iterator_tag) {
return __i1<=__i2;
}
template <class __Iterator>
inline bool __valid_range(const __Iterator& __i1 ,const __Iterator& __i2,
bidirectional_iterator_tag) {
// check if comparable
bool __dummy(__i1==__i2);
return (__dummy==__dummy);
}
template <class __Iterator>
inline bool __valid_range(const __Iterator& __i1 ,const __Iterator& __i2, forward_iterator_tag) {
// check if comparable
bool __dummy(__i1==__i2);
return (__dummy==__dummy);
}
template <class __Iterator>
inline bool __valid_range(const __Iterator&,const __Iterator&, input_iterator_tag) {
return false;
}
template <class __Iterator>
inline bool __valid_range(const __Iterator&,const __Iterator&, output_iterator_tag) {
return false;
}
template <class __Iterator>
inline bool __valid_range(const __Iterator& __i1, const __Iterator& __i2) {
return __valid_range(__i1,__i2,__ITERATOR_CATEGORY(__i1));
}
// Note : that means in range [i1, i2].
template <class __Iterator>
inline bool __in_range(const __Iterator& __it, const __Iterator& __i1,
const __Iterator& __i2) {
return __valid_range(__i1,__it,__ITERATOR_CATEGORY(__i1)) &&
__valid_range(__it,__i2,__ITERATOR_CATEGORY(__it));
}
template <class __Iterator>
inline bool __in_range(const __Iterator& __first, const __Iterator& __last,
const __Iterator& __start, const __Iterator& __finish) {
return __valid_range(__first,__last,__ITERATOR_CATEGORY(__first)) &&
__valid_range(__start,__first,__ITERATOR_CATEGORY(__first)) &&
__valid_range(__last,__finish,__ITERATOR_CATEGORY(__last));
}
//==========================================================
class __STL_CLASS_DECLSPEC __owned_link {
private:
typedef __owned_link _Self;
typedef _Self* _Self_ptr;
typedef __owned_list _Owner_type;
typedef __owned_list* _Owner_ptr;
public:
inline __owned_link(const _Owner_type* __c);
__owned_link() : _M_owner(0) {}
const _Owner_type* _Owner() const {
return _M_owner;
}
void _Set_owner(const _Owner_type* __o) {
_M_owner= __o;
}
bool _Valid() const {
return _M_owner !=0;
}
inline __owned_link(const _Self& __rhs);
inline _Self& operator=(const _Self& __rhs);
inline ~__owned_link();
void _Invalidate() { _M_owner=0; }
void _Link_to_self() { _M_next= 0; }
_Self* _Next() { return _M_next; }
const _Self* _Next() const { return _M_next; }
public:
_Self* _M_next;
const _Owner_type* _M_owner;
};
class __STL_CLASS_DECLSPEC __owned_list {
private:
typedef __owned_list _Self;
typedef _Self* _Self_ptr;
typedef __owned_link _Node;
typedef _Node* _Node_ptr;
typedef void* _Owner_ptr;
typedef const void* _Owner_const_ptr;
// should never be called, should be left undefined,
// but some compilers complain about it ;(
__owned_list(const _Self&){}
void operator=(const _Self&) {}
public:
__owned_list() {
}
~__owned_list() {
_Invalidate_all();
// that prevents detach
_M_node._Invalidate();
}
_Owner_const_ptr _Owner() const {
return (_Owner_const_ptr)_M_node._M_owner;
}
_Owner_ptr _Owner() {
return (_Owner_ptr)_M_node._M_owner;
}
bool _Valid() const {
return _M_node._M_owner!=0;
}
void _Invalidate() { _M_node._M_owner=0; }
void _Safe_init(const void* __c) {
_M_node._M_owner = (_Self_ptr)__c;
_M_node._M_next=0;
}
void _Orphan(_Node& __it) {
if ( __it._M_owner && __it._M_next != &__it ) {
__stl_debugger::_M_detach(this, &__it);
}
__it._M_next = &__it;
__it._M_owner = this;
}
_Node* _First() { return _M_node._Next(); }
_Node* _Last() { return 0 ; }
const _Node* _First() const { return (_Node*)_M_node._M_next; }
const _Node* _Last() const { return 0 ;}
void _Verify() const {
__stl_debugger::_Verify(this);
}
void _Swap_owners(_Self& __y, bool __swap_roots =false) {
__stl_debugger::_Swap_owners(*this, __y, __swap_roots);
}
void _Invalidate_all() {
__stl_debugger::_Invalidate_all(this);
}
void _M_detach(const _Node* __node) const {
__stl_debugger::_M_detach(__CONST_CAST(__owned_list*, this), __CONST_CAST(__owned_link*, __node));
}
mutable _Node _M_node;
# ifdef __STL_THREADS
mutable _STL_mutex_lock _M_lock;
# endif
private:
void _M_attach(const _Node* __n) const {
__stl_debugger::_M_attach(__CONST_CAST(__owned_list*, this), __CONST_CAST(__owned_link*,__n));
}
friend class __owned_link;
friend struct __stl_debug_engine<bool>;
};
//==========================================================
inline __owned_link::__owned_link(const __owned_list* __c): _M_owner(0) {
__c->_M_attach(this);
}
inline __owned_link::__owned_link(const __owned_link& __rhs) : _M_owner(0) {
__rhs._M_owner->_M_attach(this);
}
inline __owned_link& __owned_link::operator=(const __owned_link& __rhs) {
const _Owner_type* __new_owner = __rhs._Owner();
const _Owner_type* __old_owner = _Owner();
if ( __old_owner != __new_owner ) {
__old_owner->_M_detach(this);
__new_owner->_M_attach(this);
}
return *this;
}
inline __owned_link::~__owned_link() {
_M_owner->_M_detach(this);
}
//==========================================================
// forward declaratioins
template <class _Iterator>
bool __check_range(const _Iterator&, const _Iterator&);
template <class _Iterator>
bool __check_range(const _Iterator&,
const _Iterator&, const _Iterator&);
template <class _Iterator>
bool __check_range(const _Iterator&, const _Iterator& ,
const _Iterator&, const _Iterator& );
template <class _Iterator>
void __invalidate_range(const __owned_list* __base,
const _Iterator& __first,
const _Iterator& __last);
template <class _Iterator>
void __invalidate_iterator(const __owned_list* __base,
const _Iterator& __it);
//============================================================
inline bool
__check_same_owner( const __owned_link& __i1, const __owned_link& __i2) {
return __stl_debugger::_Check_same_owner(__i1,__i2);
}
inline bool
__check_same_owner_or_null( const __owned_link& __i1, const __owned_link& __i2) {
return __stl_debugger::_Check_same_owner_or_null(__i1,__i2);
}
template <class Iterator>
inline bool __check_if_owner( const __owned_list* __owner,
const Iterator& __it) {
return __stl_debugger::_Check_if_owner(__owner, (const __owned_link&)__it);
}
__STL_END_NAMESPACE
# endif /* __STL_DEBUG */
# if !defined (__STL_LINK_TIME_INSTANTIATION)
# include <stldebug.c>
# endif
#endif /* DEBUG_H */
// Local Variables:
// mode:C++
// End:
| [
"objectfile@gmail.com"
] | objectfile@gmail.com |
33d19ec6e757f05068482ffa41127916c4fff64c | 85c3e18522388fc6d405d3fe504b787cd97937aa | /src/src/XERenderer/GUI/LayerRenderer.cpp | 01c1377b46793200681995e4b7e76aa2f799eacf | [
"MIT"
] | permissive | blockspacer/FrankE | 2d454f77a15f02d8ac681c68730b20d189af131f | 72faca02759b54aaec842831f3c7a051e7cf5335 | refs/heads/master | 2021-05-21T10:01:23.650983 | 2019-11-12T17:44:54 | 2019-11-12T17:44:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,300 | cpp | #include <XERenderer/GUI/LayerRenderer.hpp>
#include <XERenderer/GraphicsManager.hpp>
#include <XERenderer/GUI/RenderableLayer.hpp>
#include <XERenderer/GUI/RenderableShape.hpp>
#include <XERenderer/GUI/WLayer.hpp>
#include "Vao/OgreVaoManager.h"
#include "Vao/OgreVertexArrayObject.h"
#include <Ogre/OgreMain/include/OgreSceneManager.h>
namespace XE {
LayerRenderer::LayerRenderer(GraphicsManager& graphMgr)
: m_graphMgr(graphMgr)
, _t_OgreSceneMgrPtr(0)
{
}
RenderableLayer* LayerRenderer::_t_createRenderableLayer(XE::Uint32 id, const XE::Uint16 atlasId)
{
assert(_t_OgreSceneMgrPtr);
RenderableLayer* layer = new RenderableLayer(id,
m_graphMgr.getGUIRenderer(),
&_t_OgreSceneMgrPtr->_getEntityMemoryManager(Ogre::SCENE_STATIC)
, _t_OgreSceneMgrPtr,
atlasId);
_t_renderableLayerPtrs.emplace_back(layer);
return _t_renderableLayerPtrs.back();
}
void LayerRenderer::_t_onResizeRenderWindow(size_t w, size_t h)
{
Ogre::Matrix4 projMatrix(2.0f / w, 0.0f, 0.0f, -1.0f,
0.0f, -2.0f / h, 0.0f, 1.0f,
0.0f, 0.0f, -1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
for each (auto layer in _t_renderableLayerPtrs)
{
for each (auto renderable in layer->mRenderables)
{
static_cast<ScreenRenderable*>(renderable)->setCustomProjectionMatrix(true, projMatrix);
}
}
}
void LayerRenderer::_t_destroyRenderableLayer(RenderableLayer* layer)
{
_t_renderableLayerPtrs.erase(std::find(_t_renderableLayerPtrs.begin(), _t_renderableLayerPtrs.end(), layer));
}
void LayerRenderer::addWlayer(WLayer* wlayer)
{
m_wLayers.emplace_back(wlayer);
}
void LayerRenderer::removeWlayer(WLayer* wlayer)
{
m_wLayers.erase(std::find(m_wLayers.begin(), m_wLayers.end(), wlayer));
}
void LayerRenderer::_t_initRenderer(TextureAtlas* atlas, Ogre::ObjectMemoryManager* objManager, Ogre::SceneManager* sceneMgr)
{
_t_OgreSceneMgrPtr = sceneMgr;
}
void LayerRenderer::redrawAllLayers()
{
for each (auto wlayerPtr in m_wLayers)
{
for each (auto shape in wlayerPtr->getRenderableShapes())
{
shape->_refresh();
shape->isDirty = true;
}
wlayerPtr->isDirty = true;
}
}
void LayerRenderer::update()
{
for each (auto wlayerPtr in m_wLayers)
{
wlayerPtr->update();
}
}
} | [
"misterk1@outlook.de"
] | misterk1@outlook.de |
ef992958cc1616f8947fe012ebea860a95629d8c | ea401c3e792a50364fe11f7cea0f35f99e8f4bde | /hackathon/2010/wavelets/scaleinfo.h | dc97f5ac1addd8c3d75229e9f929c1ff8e21ee6a | [
"Apache-2.0",
"MIT"
] | permissive | Vaa3D/vaa3d_tools | edb696aa3b9b59acaf83d6d27c6ae0a14bf75fe9 | e6974d5223ae70474efaa85e1253f5df1814fae8 | refs/heads/master | 2023-08-03T06:12:01.013752 | 2023-08-02T07:26:01 | 2023-08-02T07:26:01 | 50,527,925 | 107 | 86 | MIT | 2023-05-22T23:43:48 | 2016-01-27T18:19:17 | C++ | UTF-8 | C++ | false | false | 1,131 | h | /**
* scaleinfo.h
*
* Written by
*
* Ihor Smal
* Nicolas Chenouard
* Fabrice de Chaumont
*
* Paper reference: ISBI and JC Ref
*
* This code is under GPL License
*
*/
#ifndef ScaleInfo_H
#define ScaleInfo_H
#include <QtGui>
#include <math.h>
#include <stdlib.h>
#include <list>
//#include "wavelets.h"
class WaveletPlugin;
class ScaleInfo : public QObject
{
Q_OBJECT
public:
// QGroupBox *parent
ScaleInfo( WaveletPlugin *waveletPlugin , int scalNumber , QGroupBox *parent );
virtual ~ScaleInfo( );
// data
// double enabled; // is this scale enabled ?
bool enable;
double threshold; // threshold in wavelet domain.
QLabel* thresholdValueLabel;
// Qt Interface
QGroupBox *groupBox ; //= new QGroupBox( qBox );
QGridLayout *gridLayout ; //= new QGridLayout( qBox2 );
QCheckBox* enableCheckBox ;
//QLineEdit* thresholdLineEdit;
QSlider *thresholdSlider;
// QDialog *myDialog;
int thresholdValue;
// int (WaveletPlugin::*callBack)( ) = NULL;
WaveletPlugin *waveletPlugin;
// WaveletPlugin *plugin;
public slots:
void enableButtonPressed();
void sliderChange(int value );
};
#endif
| [
"hanchuan.peng@gmail.com"
] | hanchuan.peng@gmail.com |
77a3a74e998d2bdc4636d623525e5541fd17e97e | 766758b6771a711954b25db9f9683f117758fed6 | /chapter4/isBalanceTree.cpp | f40e6ad1db6a062080f84e2c18658f7fbb78a6d1 | [] | no_license | Edddddddddy/data_structure | a8d66ace875ba65ad6599e775a62f608cc99dc53 | 0f3427c99fc25cb0077e503a5ae3858c448ec074 | refs/heads/main | 2023-08-17T18:42:34.965683 | 2021-10-16T15:10:32 | 2021-10-16T15:10:32 | 405,097,519 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,065 | cpp |
/*
判断是否为平衡二叉树
分析:
左右子树深度差小于1
*/
#include <stdio.h>
#include <stdlib.h>
#include "../include/linkBiTree.cpp"
#include <algorithm>
bool isAVL(biTree *T, int *depth){
if(!T){ //叶子结点,一定是平衡二叉树
*depth = 0;
return true;
}
//不是叶子结点
//判断左右子树是否为平衡二叉树
int left = 0, right = 0; //存储
if(isAVL(T->lchild, &left) && isAVL(T->rchild, &right)){
//将孩子的diff of depth 返回给父亲
int diff = left - right;
if(abs(diff) <= 1){
// *depth = std::max(left, right) + 1;
*depth = (1 + (left > right ? left : right));
return true;
}
}
//既不是叶子结点,也不平衡,
return false;
}
int main(){
int count = 0;
biTree *T = (biTree*)malloc(sizeof(biTree));
T = create(T);
nodeNum(T, &count);
int depth;
isAVL(T, &depth) ? printf("是平衡二叉树") : printf("不是AVL");
return 0;
}
| [
"48442668+Edddddddddy@users.noreply.github.com"
] | 48442668+Edddddddddy@users.noreply.github.com |
073dc3795c94c96e9623019384f4260241795bff | 005f6e37941b66536f6719a7bb94ab4d3d7cf418 | /src/prx_visualization/prx/visualization/handler.hpp | 2982ef42cd2ac094cbb21b73af8a789776db5c5c | [] | no_license | warehouse-picking-automation-challenges/ru_pracsys | c56b9a873218fefb91658e08b74c4a1bc7e16628 | 786ce2e3e0d70d01c951028a90c117a0f23d0804 | refs/heads/master | 2021-05-31T05:52:33.396310 | 2016-02-07T22:34:39 | 2016-02-07T22:34:39 | 39,845,771 | 4 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,097 | hpp | /**
* @file handler.hpp
*
* @copyright Software License Agreement (BSD License)
* Copyright (c) 2013, Rutgers the State University of New Jersey, New Brunswick
* All Rights Reserved.
* For a full description see the file named LICENSE.
*
* Authors: Andrew Dobson, Andrew Kimmel, Athanasios Krontiris, Zakary Littlefield, Kostas Bekris
*
* Email: pracsys@googlegroups.com
*/
#pragma once
#ifndef PRACSYS_HANDLER_HPP
#define PRACSYS_HANDLER_HPP
#include "prx/utilities/definitions/defs.hpp"
#include "prx/utilities/math/configurations/vector.hpp"
namespace prx
{
namespace vis
{
/**
* This class is the input handler for the visualization tools, handling keyboard input.
*
* @brief <b> Input Handler for the visualization </b>
*
* @author Andrew Kimmel
*/
class handler_t
{
public:
/**
* The Abstract input handler destructor that does nothing
*/
virtual ~handler_t(){};
/**
* Handles the interaction with the keyboard given some key as input
*
* @brief Handles the interaction with the keyboard given some key as input
* @param input The key that was pressed on the keyboard encoded as an integer
*/
virtual void keyboard( int input ) = 0;
/**
* Called when the user clicks on nothing pickable
*
* @brief Called when the user clicks on nothing pickable
* @param point The 3D coordinates of the point selected by the user.
*/
virtual void point( const util::vector_t& point ) = 0;
/**
* Called when a body is picked by the user's mouse.
*
* @brief Called when a body is picked by the user's mouse.
* @param name The name of the object selected by the user.
*/
virtual void pick( const std::string& name ) = 0;
/**
* Called when a user moves the camera
*
* @brief Called when a user moves the camera
* @param camera The position of the camera
* @param eye The direction the camera is looking
*/
virtual void camera( const util::vector_t& camera, const util::vector_t& eye ) = 0;
};
}
}
#endif
| [
"kostas.bekris@cs.rutgers.edu"
] | kostas.bekris@cs.rutgers.edu |
c26c5c29f1eaff6bc1988b74093e6d5837126133 | 71b924cc96e150d272185208d7fecdc156d5d25c | /examples/cpuid/libcpuid/src/cpuid/hypervisors.cpp | 381fc9a30341234c97eb676cf38d2e9daf738ebd | [
"MIT"
] | permissive | DrPizza/jsm | a53b25373a95ee20123e0ac58267c3cad4f7239b | d5fc0a6c1e579bbb15c546aa3b76012ad93bc7ef | refs/heads/master | 2020-04-30T11:21:04.319926 | 2019-04-05T01:14:08 | 2019-04-05T01:14:08 | 176,799,123 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,520 | cpp | #include "stdafx.h"
#include "hypervisors.hpp"
#include "features.hpp"
#include <array>
#include <fmt/format.h>
#include "utility.hpp"
namespace cpuid {
void print_hypervisor_limit(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hypervisor_limit).at(subleaf_type::main);
format_to(out, "Hypervisor present\n");
format_to(out, "\tMaximum hypervisor leaf: {:#010x}\n", regs[eax]);
const std::array<char, 12> vndr = bit_cast<decltype(vndr)>(
std::array<std::uint32_t, 3> {
regs[ebx],
regs[ecx],
regs[edx]
}
);
format_to(out, "\tVendor: {}\n", vndr);
format_to(out, "\tVendor name: {:s}\n", to_string(cpu.vendor));
format_to(out, "\n");
}
void print_hyper_v_signature(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_signature).at(subleaf_type::main);
format_to(out, "Hyper-V signature\n");
const struct
{
std::uint32_t signature_1 : 8;
std::uint32_t signature_2 : 8;
std::uint32_t signature_3 : 8;
std::uint32_t signature_4 : 8;
} a = bit_cast<decltype(a)>(regs[eax]);
format_to(out, "\tSignature: {:c}{:c}{:c}{:c}\n", gsl::narrow_cast<char>(a.signature_1),
gsl::narrow_cast<char>(a.signature_2),
gsl::narrow_cast<char>(a.signature_3),
gsl::narrow_cast<char>(a.signature_4));
format_to(out, "\n");
}
void print_hyper_v_system_identity(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_system_identity).at(subleaf_type::main);
format_to(out, "Hyper-V system identiy\n");
const struct
{
std::uint32_t minor_version : 16;
std::uint32_t major_version : 16;
} b = bit_cast<decltype(b)>(regs[ebx]);
const struct
{
std::uint32_t service_number : 24;
std::uint32_t service_branch : 8;
} d = bit_cast<decltype(d)>(regs[edx]);
format_to(out, "\tBuild number: {:d}\n", regs[eax]);
format_to(out, "\tVersion : {:d}.{:d}\n", b.major_version, b.minor_version);
format_to(out, "\tService Pack: {:d}\n", regs[ecx]);
format_to(out, "\tService number: {:d}\n", d.service_number);
format_to(out, "\tService branch: {:d}\n", d.service_branch);
format_to(out, "\n");
}
void print_hyper_v_features(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_features).at(subleaf_type::main);
const struct
{
std::uint32_t maximum_power_state : 4;
std::uint32_t hpet_needed_for_c3 : 1;
std::uint32_t reserved_1 : 27;
} c = bit_cast<decltype(c)>(regs[ecx]);
format_to(out, "Hyper-V features\n");
print_features(out, cpu, leaf_type::hyper_v_features, subleaf_type::main, eax);
format_to(out, "\n");
print_features(out, cpu, leaf_type::hyper_v_features, subleaf_type::main, ebx);
format_to(out, "\n");
format_to(out, "\tMaximum power state: C{:d}\n", c.maximum_power_state);
if(c.hpet_needed_for_c3) {
format_to(out, "\tHPET needed for C3\n");
}
format_to(out, "\n");
print_features(out, cpu, leaf_type::hyper_v_features, subleaf_type::main, edx);
format_to(out, "\n");
}
void print_hyper_v_enlightenment_recs(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_enlightenment_recs).at(subleaf_type::main);
format_to(out, "Hyper-V recommendations\n");
print_features(out, cpu, leaf_type::hyper_v_enlightenment_recs, subleaf_type::main, eax);
format_to(out, "\n");
if(regs[ebx] != 0xffff'ffff_u32) {
format_to(out, "\tTimes to retry spinlocks before notifying hypervisor: {:d}\n", regs[ebx]);
} else {
format_to(out, "\tNever retry spinlocks before notifying hypervisor\n");
}
format_to(out, "\n");
}
void print_hyper_v_implementation_limits(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_implementation_limits).at(subleaf_type::main);
format_to(out, "Hyper-V implementation limits\n");
format_to(out, "\tMaximum virtual processors supported: {:d}\n", regs[eax]);
format_to(out, "\tMaximum logical processors supported: {:d}\n", regs[ebx]);
format_to(out, "\tMaximum physical interrupt vectors supported: {:d}\n", regs[ecx]);
format_to(out, "\n");
}
void print_hyper_v_implementation_hardware(fmt::memory_buffer& out, const cpu_t& cpu) {
format_to(out, "Hyper-V implementation hardware\n");
print_features(out, cpu, leaf_type::hyper_v_implementation_hardware, subleaf_type::main, eax);
format_to(out, "\n");
}
void print_hyper_v_root_cpu_management(fmt::memory_buffer& out, const cpu_t& cpu) {
format_to(out, "Hyper-V root CPU management\n");
print_features(out, cpu, leaf_type::hyper_v_root_cpu_management, subleaf_type::main, eax);
print_features(out, cpu, leaf_type::hyper_v_root_cpu_management, subleaf_type::main, ebx);
format_to(out, "\n");
}
void print_hyper_v_shared_virtual_memory(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_shared_virtual_memory).at(subleaf_type::main);
const struct
{
std::uint32_t svm_supported : 1;
std::uint32_t reserved_1 : 10;
std::uint32_t max_pasid_space_count : 21;
} a = bit_cast<decltype(a)>(regs[eax]);
format_to(out, "Hyper-V shared virtual memory features\n");
print_features(out, cpu, leaf_type::hyper_v_shared_virtual_memory, subleaf_type::main, eax);
format_to(out, "\n");
format_to(out, "\tMaximum PASID space count: {:d}\n", a.max_pasid_space_count);
format_to(out, "\n");
}
void print_hyper_v_nested_hypervisor(fmt::memory_buffer& out, const cpu_t& cpu) {
format_to(out, "Nested hypervisor features\n");
print_features(out, cpu, leaf_type::hyper_v_nested_hypervisor, subleaf_type::main, eax);
print_features(out, cpu, leaf_type::hyper_v_nested_hypervisor, subleaf_type::main, edx);
format_to(out, "\n");
}
void print_hyper_v_nested_features(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::hyper_v_nested_features).at(subleaf_type::main);
const struct
{
std::uint32_t low_version : 8;
std::uint32_t high_version : 8;
std::uint32_t reserved_1 : 1;
std::uint32_t direct_flush : 1;
std::uint32_t flush_guest_physical : 1;
std::uint32_t enlightened_msr_bitmap : 1;
std::uint32_t reserved_2 : 12;
} a = bit_cast<decltype(a)>(regs[eax]);
format_to(out, "Nested hypervisor virtualization features\n");
format_to(out, "\tEnlightened VMCS version: {:d}.{:d}\n", a.high_version, a.low_version);
print_features(out, cpu, leaf_type::hyper_v_nested_features, subleaf_type::main, eax);
format_to(out, "\n");
}
void print_xen_limit(fmt::memory_buffer& out, const cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_limit : leaf_type::xen_limit_offset;
const register_set_t& regs = cpu.leaves.at(leaf).at(subleaf_type::main);
format_to(out, "Xen{:s} signature\n", (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? " with viridian extensions" : "");
format_to(out, "\tMaximum Xen leaf: {:#010x}\n", regs[eax]);
const std::array<char, 12> vndr = bit_cast<decltype(vndr)>(
std::array<std::uint32_t, 3> {
regs[ebx],
regs[ecx],
regs[edx]
}
);
format_to(out, "\tVendor: {}\n", vndr);
format_to(out, "\tVendor name: {:s}\n", to_string(cpu.vendor));
format_to(out, "\n");
}
void print_xen_version(fmt::memory_buffer& out, const cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_version : leaf_type::xen_version_offset;
const register_set_t& regs = cpu.leaves.at(leaf).at(subleaf_type::main);
const struct
{
std::uint32_t minor_version : 16;
std::uint32_t major_version : 16;
} a = bit_cast<decltype(a)>(regs[eax]);
format_to(out, "Xen version\n");
format_to(out, "\tVersion : {:d}.{:d}\n", a.major_version, a.minor_version);
format_to(out, "\n");
}
void print_xen_features(fmt::memory_buffer& out, const cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_features : leaf_type::xen_features_offset;
const register_set_t& regs = cpu.leaves.at(leaf).at(subleaf_type::main);
format_to(out, "Xen features\n");
format_to(out, "\tHypercall transfer pages: {:d}\n", regs[eax]);
format_to(out, "\tXen MSR base address: {:#010x}\n", regs[ebx]);
format_to(out, "\n");
}
void enumerate_xen_time(cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_time : leaf_type::xen_time_offset;
cpu.leaves[leaf][subleaf_type::xen_time_main ] = cpuid(leaf, subleaf_type::xen_time_main );
cpu.leaves[leaf][subleaf_type::xen_time_tsc_offset] = cpuid(leaf, subleaf_type::xen_time_tsc_offset);
cpu.leaves[leaf][subleaf_type::xen_time_host ] = cpuid(leaf, subleaf_type::xen_time_host );
}
void print_xen_time(fmt::memory_buffer& out, const cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_time : leaf_type::xen_time_offset;
for(const auto& sub : cpu.leaves.at(leaf)) {
const register_set_t& regs = sub.second;
switch(sub.first) {
case subleaf_type::xen_time_main:
format_to(out, "Xen time features\n");
print_features(out, cpu, leaf, subleaf_type::xen_time_main, eax);
format_to(out, "\n");
format_to(out, "\tTSC mode: {:#010x}\n", regs[ebx]);
format_to(out, "\tTSC/kHz: {:d}\n", regs[ecx]);
format_to(out, "\tTSC restarts: {:d}\n", regs[ecx]);
format_to(out, "\n");
break;
case subleaf_type::xen_time_tsc_offset:
{
const std::uint64_t tsc_offset = (gsl::narrow_cast<std::uint64_t>(regs[ebx]) << 32_u64) | gsl::narrow_cast<std::uint64_t>(regs[eax]);
format_to(out, "Xen TSC scaling and offset\n");
format_to(out, "\tTSC offset: {:d}\n", tsc_offset);
format_to(out, "\tTSC to nanoseconds factor: {:d}\n", regs[ecx]);
format_to(out, "\tTSC to nanoseconds shift: {:d}\n", gsl::narrow_cast<std::int8_t>(regs[edx]));
format_to(out, "\n");
}
break;
case subleaf_type::xen_time_host:
format_to(out, "Xen host CPU\n");
format_to(out, "\tHost CPU speed/kHz: {:d}\n", regs[eax]);
format_to(out, "\n");
break;
default:
format_to(out, "Xen unknown time subleaf\n");
print_generic(out, cpu, leaf, sub.first);
format_to(out, "\n");
}
}
}
void print_xen_hvm_features(fmt::memory_buffer& out, const cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_hvm_features : leaf_type::xen_hvm_features_offset;
const register_set_t& regs = cpu.leaves.at(leaf).at(subleaf_type::main);
format_to(out, "Xen HVM features\n");
print_features(out, cpu, leaf, subleaf_type::main, eax);
if(0x0000'0008_u32 & cpu.leaves.at(leaf).at(subleaf_type::main).at(eax)) {
format_to(out, "\tVCPU ID: {:#010x}\n", regs[ebx]);
}
format_to(out, "\n");
}
void print_xen_pv_features(fmt::memory_buffer& out, const cpu_t& cpu) {
const leaf_type leaf = (cpu.vendor & vendor_type::hyper_v) == vendor_type::hyper_v ? leaf_type::xen_pv_features : leaf_type::xen_pv_features_offset;
const register_set_t& regs = cpu.leaves.at(leaf).at(subleaf_type::main);
const struct
{
std::uint32_t machine_address_width : 8;
std::uint32_t reserved_1 : 24;
} b = bit_cast<decltype(b)>(regs[ebx]);
format_to(out, "Xen PV features\n");
format_to(out, "\tHighest subleaf: {:#010x}\n", regs[eax]);
format_to(out, "\n");
}
void print_vmware_timing(fmt::memory_buffer& out, const cpu_t& cpu) {
const register_set_t& regs = cpu.leaves.at(leaf_type::vmware_timing).at(subleaf_type::main);
format_to(out, "VMware timing\n");
format_to(out, "\tVirtual TSC frequency/kHz: {:d}\n", regs[eax]);
format_to(out, "\tVirtual bus/APIC frequency/kHz: {:d}\n", regs[ebx]);
format_to(out, "\n");
}
void print_kvm_features(fmt::memory_buffer& out, const cpu_t& cpu) {
format_to(out, "KVM features\n");
print_features(out, cpu, leaf_type::kvm_features, subleaf_type::main, eax);
format_to(out, "\n");
}
}
| [
"drpizza@quiscalusmexicanus.org"
] | drpizza@quiscalusmexicanus.org |
1c25733d82b043f4ff4d28357cf7541bb4399d8b | 1aafb6d9f2e62713f5327f1d7e0e150c8208c150 | /catkin_ws/devel/include/pkg1/complexOperationRequest.h | ab10b276422e5be619a935a259a4a1b233983516 | [] | no_license | malayaj2000/ROS-Task1 | a9c35826c08f96586836624175549b8fca97fcab | 6f5f4396763f93765faa75299e9cb82e96ecb1fb | refs/heads/main | 2023-03-30T02:36:12.543092 | 2021-03-27T05:28:12 | 2021-03-27T05:28:12 | 337,090,213 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,947 | h | // Generated by gencpp from file pkg1/complexOperationRequest.msg
// DO NOT EDIT!
#ifndef PKG1_MESSAGE_COMPLEXOPERATIONREQUEST_H
#define PKG1_MESSAGE_COMPLEXOPERATIONREQUEST_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h>
#include <ros/builtin_message_traits.h>
#include <ros/message_operations.h>
namespace pkg1
{
template <class ContainerAllocator>
struct complexOperationRequest_
{
typedef complexOperationRequest_<ContainerAllocator> Type;
complexOperationRequest_()
: r1(0)
, r2(0)
, i1(0)
, i2(0)
, op() {
}
complexOperationRequest_(const ContainerAllocator& _alloc)
: r1(0)
, r2(0)
, i1(0)
, i2(0)
, op(_alloc) {
(void)_alloc;
}
typedef int64_t _r1_type;
_r1_type r1;
typedef int64_t _r2_type;
_r2_type r2;
typedef int64_t _i1_type;
_i1_type i1;
typedef int64_t _i2_type;
_i2_type i2;
typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _op_type;
_op_type op;
typedef boost::shared_ptr< ::pkg1::complexOperationRequest_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::pkg1::complexOperationRequest_<ContainerAllocator> const> ConstPtr;
}; // struct complexOperationRequest_
typedef ::pkg1::complexOperationRequest_<std::allocator<void> > complexOperationRequest;
typedef boost::shared_ptr< ::pkg1::complexOperationRequest > complexOperationRequestPtr;
typedef boost::shared_ptr< ::pkg1::complexOperationRequest const> complexOperationRequestConstPtr;
// constants requiring out of line definition
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::pkg1::complexOperationRequest_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::pkg1::complexOperationRequest_<ContainerAllocator> >::stream(s, "", v);
return s;
}
template<typename ContainerAllocator1, typename ContainerAllocator2>
bool operator==(const ::pkg1::complexOperationRequest_<ContainerAllocator1> & lhs, const ::pkg1::complexOperationRequest_<ContainerAllocator2> & rhs)
{
return lhs.r1 == rhs.r1 &&
lhs.r2 == rhs.r2 &&
lhs.i1 == rhs.i1 &&
lhs.i2 == rhs.i2 &&
lhs.op == rhs.op;
}
template<typename ContainerAllocator1, typename ContainerAllocator2>
bool operator!=(const ::pkg1::complexOperationRequest_<ContainerAllocator1> & lhs, const ::pkg1::complexOperationRequest_<ContainerAllocator2> & rhs)
{
return !(lhs == rhs);
}
} // namespace pkg1
namespace ros
{
namespace message_traits
{
template <class ContainerAllocator>
struct IsFixedSize< ::pkg1::complexOperationRequest_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct IsFixedSize< ::pkg1::complexOperationRequest_<ContainerAllocator> const>
: FalseType
{ };
template <class ContainerAllocator>
struct IsMessage< ::pkg1::complexOperationRequest_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::pkg1::complexOperationRequest_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct HasHeader< ::pkg1::complexOperationRequest_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct HasHeader< ::pkg1::complexOperationRequest_<ContainerAllocator> const>
: FalseType
{ };
template<class ContainerAllocator>
struct MD5Sum< ::pkg1::complexOperationRequest_<ContainerAllocator> >
{
static const char* value()
{
return "1a4d49636a1a8ef4d06efda894189865";
}
static const char* value(const ::pkg1::complexOperationRequest_<ContainerAllocator>&) { return value(); }
static const uint64_t static_value1 = 0x1a4d49636a1a8ef4ULL;
static const uint64_t static_value2 = 0xd06efda894189865ULL;
};
template<class ContainerAllocator>
struct DataType< ::pkg1::complexOperationRequest_<ContainerAllocator> >
{
static const char* value()
{
return "pkg1/complexOperationRequest";
}
static const char* value(const ::pkg1::complexOperationRequest_<ContainerAllocator>&) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::pkg1::complexOperationRequest_<ContainerAllocator> >
{
static const char* value()
{
return "int64 r1\n"
"int64 r2\n"
"int64 i1\n"
"int64 i2\n"
"string op\n"
;
}
static const char* value(const ::pkg1::complexOperationRequest_<ContainerAllocator>&) { return value(); }
};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::pkg1::complexOperationRequest_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.r1);
stream.next(m.r2);
stream.next(m.i1);
stream.next(m.i2);
stream.next(m.op);
}
ROS_DECLARE_ALLINONE_SERIALIZER
}; // struct complexOperationRequest_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::pkg1::complexOperationRequest_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pkg1::complexOperationRequest_<ContainerAllocator>& v)
{
s << indent << "r1: ";
Printer<int64_t>::stream(s, indent + " ", v.r1);
s << indent << "r2: ";
Printer<int64_t>::stream(s, indent + " ", v.r2);
s << indent << "i1: ";
Printer<int64_t>::stream(s, indent + " ", v.i1);
s << indent << "i2: ";
Printer<int64_t>::stream(s, indent + " ", v.i2);
s << indent << "op: ";
Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.op);
}
};
} // namespace message_operations
} // namespace ros
#endif // PKG1_MESSAGE_COMPLEXOPERATIONREQUEST_H
| [
"malayajrath@gmail.com"
] | malayajrath@gmail.com |
65371263461eb19c6e9c704ba7b4bca78725ce89 | 14114f36cbfb62c5077bb062668e570298e2f295 | /Classes/CrayonBox.h | 0428f4be298cf22383dac0537f040315e828bdef | [] | no_license | Crasader/cc2d-multiplayer | 45b4df6b035c53327e7e68abf642e823f7f8aded | 5c15922b36ba4288f3061fa565b8eaf42d736296 | refs/heads/master | 2020-11-28T14:44:38.468894 | 2017-06-26T22:58:38 | 2017-06-26T22:58:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 320 | h | #ifndef __CRAYONBOX_H__
#define __CRAYONBOX_H__
#include "GameObject.h"
class DynamicCrayonRenderer;
class CrayonBox : public GameObject
{
public:
CrayonBox(GameSystem* game, const cocos2d::Vec2& pos, Parameters& spawnArgs);
virtual ~CrayonBox();
std::unique_ptr<DynamicCrayonRenderer> mCrayonRenderer;
};
#endif | [
"uk002167@student.uni-kassel.de"
] | uk002167@student.uni-kassel.de |
7360886fb87516f68ba4011dfa56a034e502098a | 92716299dd8d22e812ef918fffe4887326397b73 | /plugins/BTaggingExerciseII.cc | 078c8b48e7e8f8d67793349c127a71ea7b65ca54 | [] | no_license | gourangakole/CMSDAS2015-BTaggingExercise | 27227bbffddb12c2bf48b390ab72dc27b756764c | ac13c05e373dbea4714f6ecfe3760832d6193f19 | refs/heads/master | 2021-01-18T04:51:18.225038 | 2015-07-11T02:19:56 | 2015-07-11T02:24:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,920 | cc | // -*- C++ -*-
//
// Package: CMSDAS2015/BTaggingExercise
// Class: BTaggingExerciseII
//
/**\class BTaggingExerciseII BTaggingExerciseII.cc CMSDAS2015/BTaggingExercise/plugins/BTaggingExerciseII.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: Dinko Ferencek
// Created: Tue, 16 Dec 2014 00:09:47 GMT
//
//
// system include files
#include <memory>
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/PatCandidates/interface/Jet.h"
#include "TH2F.h"
//
// class declaration
//
class BTaggingExerciseII : public edm::EDAnalyzer {
public:
explicit BTaggingExerciseII(const edm::ParameterSet&);
~BTaggingExerciseII();
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
private:
virtual void beginJob() override;
virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override;
//virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
//virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
//virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
//virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
// ----------member data ---------------------------
const edm::InputTag jets_;
const std::vector<std::string> bDiscriminators_;
edm::Service<TFileService> fs;
// declare a map of b-tag discriminator histograms
std::map<std::string, TH2F *> bDiscriminatorsMap;
};
//
// constants, enums and typedefs
//
//
// static data member definitions
//
//
// constructors and destructor
//
BTaggingExerciseII::BTaggingExerciseII(const edm::ParameterSet& iConfig) :
jets_(iConfig.getParameter<edm::InputTag>("jets")),
bDiscriminators_(iConfig.getParameter<std::vector<std::string> >("bDiscriminators"))
{
std::string bDiscr_flav = "";
// initialize b-tag discriminator histograms
for( const std::string &bDiscr : bDiscriminators_ )
{
for( const std::string &flav : {"b","c","udsg"} )
{
bDiscr_flav = bDiscr + "_" + flav;
if( bDiscr.find("Counting") != std::string::npos ) // track counting discriminator can be both positive and negative and covers a wider range then other discriminators
bDiscriminatorsMap[bDiscr_flav] = fs->make<TH2F>(bDiscr_flav.c_str(), (bDiscr_flav + ";Jet p_{T} [GeV];b-tag discriminator").c_str(), 20, 0, 200, 11000, -15, 40);
else
bDiscriminatorsMap[bDiscr_flav] = fs->make<TH2F>(bDiscr_flav.c_str(), (bDiscr_flav + ";Jet p_{T} [GeV];b-tag discriminator").c_str(), 20, 0, 200, 4400, -11, 11);
}
}
}
BTaggingExerciseII::~BTaggingExerciseII()
{
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
}
//
// member functions
//
// ------------ method called for each event ------------
void
BTaggingExerciseII::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{
// define a jet handle
edm::Handle<std::vector<pat::Jet> > jets;
// get jets from the event
iEvent.getByLabel(jets_, jets);
std::string bDiscr_flav = "";
// loop over jets
for( auto jet = jets->begin(); jet != jets->end(); ++jet )
{
int flavor = std::abs( jet->partonFlavour() );
// fill discriminator histograms
for( const std::string &bDiscr : bDiscriminators_ )
{
if( flavor==0 ) continue; // skip jets with undefined flavor
if( jet->pt()<30. || std::abs(jet->eta())>2.4 ) continue; // skip jets with low pT or outside the tracker acceptance
if( flavor==5 ) // b jet
bDiscr_flav = bDiscr + "_b";
else if( flavor==4 ) // c jets
bDiscr_flav = bDiscr + "_c";
else // light-flavor jet
bDiscr_flav = bDiscr + "_udsg";
bDiscriminatorsMap[bDiscr_flav]->Fill( jet->pt(), jet->bDiscriminator(bDiscr) );
}
}
}
// ------------ method called once each job just before starting event loop ------------
void
BTaggingExerciseII::beginJob()
{
}
// ------------ method called once each job just after ending the event loop ------------
void
BTaggingExerciseII::endJob()
{
}
// ------------ method called when starting to processes a run ------------
/*
void
BTaggingExerciseII::beginRun(edm::Run const&, edm::EventSetup const&)
{
}
*/
// ------------ method called when ending the processing of a run ------------
/*
void
BTaggingExerciseII::endRun(edm::Run const&, edm::EventSetup const&)
{
}
*/
// ------------ method called when starting to processes a luminosity block ------------
/*
void
BTaggingExerciseII::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
{
}
*/
// ------------ method called when ending the processing of a luminosity block ------------
/*
void
BTaggingExerciseII::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
{
}
*/
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
void
BTaggingExerciseII::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.setUnknown();
descriptions.addDefault(desc);
}
//define this as a plug-in
DEFINE_FWK_MODULE(BTaggingExerciseII);
| [
"Dinko.Ferencek@cern.ch"
] | Dinko.Ferencek@cern.ch |
097bb99f49d78804695194d440237a0dc422e3d6 | b1aa9ad6733efcb53d465809d5109e9174dabf04 | /CCode/GameCode/MGGrenadeLauncher.cpp | d97f34f97c398bed387cd166d196f24d8b2adeed | [] | no_license | dumpinfo/GameMatrixTest | d21545dbef9ade76fe092343a8362da4c8b142ca | 9e4a73ad17555ddb90020c47e2486698b90e4d0d | refs/heads/master | 2023-02-04T01:52:05.342214 | 2020-12-23T17:22:36 | 2020-12-23T17:22:36 | 323,961,033 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,629 | cpp | //=============================================================
//
// C4 Engine version 4.5
// Copyright 1999-2015, by Terathon Software LLC
//
// This file is part of the C4 Engine and is provided under the
// terms of the license agreement entered by the registed user.
//
// Unauthorized redistribution of source code is strictly
// prohibited. Violators will be prosecuted.
//
//=============================================================
#include "MGGrenadeLauncher.h"
#include "MGFighter.h"
#include "MGGame.h"
using namespace C4;
namespace
{
const float kGrenadeSplashDamageRadius = 5.0F;
Storage<GrenadeLauncher> grenadeLauncherStorage;
}
GrenadeLauncher::GrenadeLauncher() :
Weapon(kWeaponGrenadeLauncher, 0, kModelGrenadeLauncher, kActionGrenadeLauncher, 20, 40),
grenadeControllerRegistration(kControllerGrenade, nullptr),
grenadeLauncherModelRegistration(kModelGrenadeLauncher, TheGame->GetStringTable()->GetString(StringID('MODL', 'WEAP', kModelGrenadeLauncher)), "grenade/gun/GrenadeLauncher", kModelPrecache, kControllerCollectable),
grenadeAmmoModelRegistration(kModelGrenadeAmmo, TheGame->GetStringTable()->GetString(StringID('MODL', 'AMMO', kModelGrenadeAmmo)), "grenade/ammo/Ammo", kModelPrecache, kControllerCollectable),
grenadeModelRegistration(kModelGrenade, nullptr, "grenade/grenade/Grenade", kModelPrecache | kModelPrivate),
grenadeLauncherAction(kWeaponGrenadeLauncher)
{
TheInputMgr->AddAction(&grenadeLauncherAction);
}
GrenadeLauncher::~GrenadeLauncher()
{
}
void GrenadeLauncher::Construct(void)
{
new(grenadeLauncherStorage) GrenadeLauncher;
}
void GrenadeLauncher::Destruct(void)
{
grenadeLauncherStorage->~GrenadeLauncher();
}
WeaponController *GrenadeLauncher::NewWeaponController(FighterController *fighter) const
{
return (new GrenadeLauncherController(fighter));
}
GrenadeLauncherController::GrenadeLauncherController(FighterController *fighter) : WeaponController(kControllerGrenadeLauncher, fighter)
{
}
GrenadeLauncherController::~GrenadeLauncherController()
{
}
void GrenadeLauncherController::Preprocess(void)
{
WeaponController::Preprocess();
currentDrumAngle = 0.0F;
targetDrumAngle = 0.0F;
Model *model = GetTargetNode();
drumNode = model->FindNode(Text::StaticHash<'D', 'r', 'u', 'm'>::value);
frameAnimator.SetTargetModel(model);
frameAnimator.SetAnimation("grenade/gun/Fire");
model->SetRootAnimator(&frameAnimator);
}
ControllerMessage *GrenadeLauncherController::CreateMessage(ControllerMessageType type) const
{
switch (type)
{
case kGrenadeLauncherMessageAdvance:
return (new GrenadeLauncherAdvanceMessage(GetControllerIndex()));
}
return (WeaponController::CreateMessage(type));
}
void GrenadeLauncherController::Move(void)
{
float angle = currentDrumAngle;
float target = targetDrumAngle;
if (angle < target)
{
angle += TheTimeMgr->GetFloatDeltaTime() * 0.005F;
if (!(angle < target))
{
if (target >= 8.0F)
{
target = 0.0F;
}
targetDrumAngle = target;
angle = target;
}
currentDrumAngle = angle;
drumNode->SetNodeMatrix3D(Matrix3D().SetRotationAboutX(angle * K::tau_over_8));
drumNode->Invalidate();
}
GetTargetNode()->Animate();
}
void GrenadeLauncherController::ShowFireAnimation(void)
{
targetDrumAngle += 1.0F;
frameAnimator.GetFrameInterpolator()->Set(0.0F, 1.0F, kInterpolatorForward);
}
WeaponResult GrenadeLauncherController::UpdateWeapon(const Point3D& position, const Vector3D& direction, const Point3D& center)
{
if (TheMessageMgr->Server())
{
int32 dt = TheTimeMgr->GetDeltaTime();
int32 time = GetFireDelayTime() - dt;
const FighterController *fighter = GetFighterController();
unsigned_int32 flags = fighter->GetFighterFlags();
if (((flags & kFighterFiring) != 0) && (time <= 0))
{
SetFireDelayTime(time + 500);
GamePlayer *player = fighter->GetFighterPlayer();
int32 ammo = player->GetWeaponAmmo(kWeaponGrenadeLauncher, 0);
if (ammo <= 0)
{
return (kWeaponEmpty);
}
player->SetWeaponAmmo(kWeaponGrenadeLauncher, 0, ammo - 1);
World *world = GetTargetNode()->GetWorld();
int32 projectileIndex = world->NewControllerIndex();
TheMessageMgr->SendMessageAll(CreateGrenadeMessage(projectileIndex, fighter->GetControllerIndex(), position, direction * 20.0F));
ProjectileController *projectileController = static_cast<ProjectileController *>(world->GetController(projectileIndex));
projectileController->SetFirstPosition(center);
TheMessageMgr->SendMessageAll(GrenadeLauncherAdvanceMessage(GetControllerIndex()));
return (kWeaponFired);
}
else
{
SetFireDelayTime(time);
}
}
return (kWeaponIdle);
}
GrenadeLauncherAdvanceMessage::GrenadeLauncherAdvanceMessage(int32 index) : ControllerMessage(GrenadeLauncherController::kGrenadeLauncherMessageAdvance, index)
{
}
GrenadeLauncherAdvanceMessage::~GrenadeLauncherAdvanceMessage()
{
}
void GrenadeLauncherAdvanceMessage::HandleControllerMessage(Controller *controller) const
{
static_cast<GrenadeLauncherController *>(controller)->ShowFireAnimation();
}
GrenadeExplosionParticleSystem::GrenadeExplosionParticleSystem(const Vector3D& velocity) :
TexcoordPointParticleSystem(kParticleSystemGrenadeExplosion, &particlePool, "particle/Puff1"),
particlePool(kMaxParticleCount, particleArray)
{
explosionVelocity = velocity * 0.001F;
}
GrenadeExplosionParticleSystem::~GrenadeExplosionParticleSystem()
{
}
bool GrenadeExplosionParticleSystem::CalculateBoundingSphere(BoundingSphere *sphere) const
{
sphere->SetCenter(0.0F, 0.0F, 0.0F);
sphere->SetRadius(16.0F);
return (true);
}
void GrenadeExplosionParticleSystem::Preprocess(void)
{
SetParticleSystemFlags(kParticleSystemSelfDestruct | kParticleSystemSoftDepth);
TexcoordPointParticleSystem::Preprocess();
SetAmbientBlendState(kBlendInterpolate | kBlendAlphaPreserve);
SetTransparentPosition(&GetWorldPosition());
SetSoftDepthScale(2.0F);
if (!GetFirstParticle())
{
Point3D center = GetSuperNode()->GetWorldTransform() * GetNodePosition();
const ConstVector2D *trig = Math::GetTrigTable();
for (machine a = 0; a < 20; a++)
{
SmokeParticle *particle = particlePool.NewParticle();
particle->emitTime = 0;
particle->lifeTime = Math::Random(800) + 200;
particle->radius = 0.1F + Math::RandomFloat(0.5F);
particle->color.Set(1.0F, Math::RandomFloat(0.5F) + 0.25F, 0.0F, 1.0F);
particle->orientation = Math::Random(256) << 24;
particle->position = center;
float speed = Math::RandomFloat(0.01F) + 0.005F;
Vector2D csp = trig[Math::Random(128)] * speed;
const Vector2D& cst = trig[Math::Random(256)];
particle->velocity.Set(cst.x * csp.y, cst.y * csp.y, csp.x);
particle->velocity += explosionVelocity;
int32 i = Math::Random(4);
particle->texcoordScale.Set(0.5F, 0.5F);
particle->texcoordOffset.Set((i & 1) ? 0.5F : 0.0F, (i & 2) ? 0.5F : 0.0F);
particle->smokeCount = 0;
AddParticle(particle);
}
}
}
void GrenadeExplosionParticleSystem::AnimateParticles(void)
{
int32 dt = TheTimeMgr->GetDeltaTime();
float fdt = TheTimeMgr->GetFloatDeltaTime();
SmokeParticle *particle = static_cast<SmokeParticle *>(GetFirstParticle());
while (particle)
{
SmokeParticle *next = particle->GetNextParticle();
int32 life = (particle->lifeTime -= dt);
if (life > 0)
{
if (life < 500)
{
particle->color.alpha = Fmin((float) life * 0.002F, particle->color.alpha);
}
Fixed count = particle->smokeCount;
if (count < 0)
{
particle->radius += fdt * 0.001F;
float f = Exp(fdt * -0.003F);
particle->color.red *= f;
particle->color.green *= f;
}
else
{
particle->velocity.z += K::gravity * 0.5F * fdt;
Vector3D dp = particle->velocity * fdt;
particle->position += dp;
int32 k = count + dt;
count = k >> 5;
particle->smokeCount = k - (count << 5);
for (machine a = 0; a < count; a++)
{
SmokeParticle *p = particlePool.NewParticle();
if (!p)
{
break;
}
p->emitTime = 0;
p->lifeTime = Math::Random(1000) + 500;
p->radius = 0.2F;
p->color = particle->color;
p->orientation = Math::Random(256) << 24;
p->position = particle->position - dp * Math::RandomFloat(1.0F);
p->velocity.Set(0.0F, 0.0F, 0.0F);
int32 i = Math::Random(4);
p->texcoordScale.Set(0.5F, 0.5F);
p->texcoordOffset.Set((i & 1) ? 0.5F : 0.0F, (i & 2) ? 0.5F : 0.0F);
p->smokeCount = -1;
AddParticle(p);
}
}
}
else
{
FreeParticle(particle);
}
particle = next;
}
}
GrenadeSparksParticleSystem::GrenadeSparksParticleSystem(const Vector3D& velocity) :
LineParticleSystem(kParticleSystemGrenadeSparks, &particlePool, "particle/Spark1"),
particlePool(kMaxParticleCount, particleArray)
{
sparksVelocity = velocity * 0.001F;
SetLengthMultiplier(8.0F);
}
GrenadeSparksParticleSystem::~GrenadeSparksParticleSystem()
{
}
bool GrenadeSparksParticleSystem::CalculateBoundingSphere(BoundingSphere *sphere) const
{
sphere->SetCenter(0.0F, 0.0F, 0.0F);
sphere->SetRadius(10.0F);
return (true);
}
void GrenadeSparksParticleSystem::Preprocess(void)
{
LineParticleSystem::Preprocess();
SetParticleSystemFlags(kParticleSystemSelfDestruct);
if (!GetFirstParticle())
{
Point3D center = GetSuperNode()->GetWorldTransform() * GetNodePosition();
const ConstVector2D *trig = Math::GetTrigTable();
for (machine a = 0; a < kMaxParticleCount; a++)
{
Particle *particle = particlePool.NewParticle();
particle->emitTime = 0;
particle->lifeTime = 1000 + Math::Random(500);
particle->radius = Math::RandomFloat(0.025F) + 0.05F;
float blue = Math::RandomFloat(1.0F);
particle->color.Set(1.0F, blue + Math::RandomFloat(1.0F - blue), blue, 1.0F);
particle->orientation = 0;
particle->position = center;
int32 phi = Math::Random(128);
int32 theta = Math::Random(256);
float speed = Math::RandomFloat(0.0125F) + 0.0025F;
Vector2D csp = trig[phi] * speed;
const Vector2D& cst = trig[theta];
particle->velocity.Set(cst.x * csp.y, cst.y * csp.y, csp.x);
particle->velocity += sparksVelocity;
AddParticle(particle);
}
}
}
void GrenadeSparksParticleSystem::AnimateParticles(void)
{
int32 dt = TheTimeMgr->GetDeltaTime();
float fdt = TheTimeMgr->GetFloatDeltaTime();
Particle *particle = GetFirstParticle();
while (particle)
{
Particle *next = particle->nextParticle;
int32 life = (particle->lifeTime -= dt);
if (life > 0)
{
if (life < 400)
{
particle->color.alpha = (float) life * 0.0025F;
}
particle->velocity.z += K::gravity * fdt;
particle->position += particle->velocity * fdt;
}
else
{
FreeParticle(particle);
}
particle = next;
}
}
GrenadeController::GrenadeController() : ProjectileController(kControllerGrenade)
{
smokeTrail = nullptr;
}
GrenadeController::GrenadeController(const Vector3D& velocity, GameCharacterController *attacker) : ProjectileController(kControllerGrenade, velocity, attacker)
{
lifeTime = 10000;
collisionCount = 0;
smokeTime = 250;
smokeTrail = nullptr;
}
GrenadeController::GrenadeController(const GrenadeController& grenadeController) : ProjectileController(grenadeController)
{
lifeTime = grenadeController.lifeTime;
collisionCount = 0;
smokeTime = 250;
smokeTrail = nullptr;
}
GrenadeController::~GrenadeController()
{
if (smokeTrail)
{
smokeTrail->Finalize();
}
}
Controller *GrenadeController::Replicate(void) const
{
return (new GrenadeController(*this));
}
void GrenadeController::Pack(Packer& data, unsigned_int32 packFlags) const
{
ProjectileController::Pack(data, packFlags);
data << ChunkHeader('LIFE', 4);
data << lifeTime;
data << ChunkHeader('STIM', 4);
data << smokeTime;
data << ChunkHeader('COLL', 4);
data << collisionCount;
if ((smokeTrail) && (smokeTrail->LinkedNodePackable(packFlags)))
{
data << ChunkHeader('TRAL', 4);
data << smokeTrail->GetNodeIndex();
}
data << TerminatorChunk;
}
void GrenadeController::Unpack(Unpacker& data, unsigned_int32 unpackFlags)
{
ProjectileController::Unpack(data, unpackFlags);
UnpackChunkList<GrenadeController>(data, unpackFlags);
}
bool GrenadeController::UnpackChunk(const ChunkHeader *chunkHeader, Unpacker& data, unsigned_int32 unpackFlags)
{
switch (chunkHeader->chunkType)
{
case 'LIFE':
data >> lifeTime;
return (true);
case 'STIM':
data >> smokeTime;
return (true);
case 'COLL':
data >> collisionCount;
return (true);
case 'TRAL':
{
int32 nodeIndex;
data >> nodeIndex;
data.AddNodeLink(nodeIndex, &SmokeTrailLinkProc, this);
return (true);
}
}
return (false);
}
void GrenadeController::SmokeTrailLinkProc(Node *node, void *cookie)
{
GrenadeController *controller = static_cast<GrenadeController *>(cookie);
controller->smokeTrail = static_cast<SmokeTrailParticleSystem *>(node);
}
void GrenadeController::Preprocess(void)
{
ProjectileController::Preprocess();
SetRigidBodyFlags(kRigidBodyPartialSleep);
SetCollisionKind(GetCollisionKind() | kCollisionShot);
SetRestitutionCoefficient(0.75F);
Model *model = GetTargetNode();
Transform4D transform = CalculateProjectileTransform(model->GetWorldPosition(), GetLinearVelocity());
SetAngularVelocity(transform[0] * -2.0F);
SetRigidBodyTransform(transform);
model->Invalidate();
if (!smokeTrail)
{
smokeTrail = new SmokeTrailParticleSystem(ColorRGBA(1.0F, 1.0F, 1.0F, 0.3F));
model->GetWorld()->AddNewNode(smokeTrail);
}
}
ControllerMessage *GrenadeController::CreateMessage(ControllerMessageType type) const
{
switch (type)
{
case kGrenadeMessageTeleport:
return (new GrenadeTeleportMessage(GetControllerIndex()));
case kGrenadeMessageExplode:
return (new GrenadeExplodeMessage(GetControllerIndex()));
}
return (ProjectileController::CreateMessage(type));
}
void GrenadeController::SendInitialStateMessages(Player *player) const
{
player->SendMessage(CreateGrenadeMessage(GetControllerIndex(), GetAttackerIndex(), GetTargetNode()->GetWorldPosition(), GetLinearVelocity()));
}
void GrenadeController::Move(void)
{
int32 dt = TheTimeMgr->GetDeltaTime();
if (TheMessageMgr->Server())
{
if ((lifeTime -= dt) <= 0)
{
const Point3D& position = GetTargetNode()->GetWorldPosition();
const Vector3D& velocity = GetLinearVelocity();
float m = SquaredMag(velocity);
if (m > K::min_float)
{
GrenadeController::Destroy(position, velocity * -InverseSqrt(m));
}
else
{
GrenadeController::Destroy(position, K::z_unit);
}
return;
}
}
if ((smokeTime -= dt) <= 0)
{
smokeTime = MaxZero(smokeTime + 30);
const Node *node = GetTargetNode();
smokeTrail->CreateSmoke(node->GetWorldPosition() - node->GetWorldTransform()[2] * 0.125F, 750, 0.1F);
}
}
RigidBodyStatus GrenadeController::HandleNewRigidBodyContact(const RigidBodyContact *contact, RigidBodyController *contactBody)
{
if (TheMessageMgr->Server())
{
if (contactBody->GetRigidBodyType() == kRigidBodyCharacter)
{
Point3D worldPosition;
Vector3D worldNormal;
contact->GetWorldContactPosition(this, &worldPosition, &worldNormal);
GrenadeController::Destroy(worldPosition, worldNormal);
return (kRigidBodyDestroyed);
}
}
Bounce();
return (kRigidBodyUnchanged);
}
RigidBodyStatus GrenadeController::HandleNewGeometryContact(const GeometryContact *contact)
{
const Geometry *geometry = contact->GetContactGeometry();
const RemotePortal *portal = Game::DetectTeleporter(geometry);
if (TheMessageMgr->Server())
{
if (portal)
{
// Grenade goes through a teleporting portal.
Transform4D portalTransform;
portal->CalculateRemoteTransform(&portalTransform);
const Transform4D& worldTransform = GetFinalTransform();
Point3D position = portalTransform * worldTransform.GetTranslation();
Vector3D velocity = portalTransform * GetOriginalLinearVelocity();
Point3D center = worldTransform * (contact->GetRigidBodyContactPosition() - contact->GetRigidBodyContactNormal() * 0.5F);
TheMessageMgr->SendMessageAll(GrenadeTeleportMessage(GetControllerIndex(), position, velocity, center));
return (kRigidBodyContactsBroken);
}
}
if (!portal)
{
Bounce();
}
return (kRigidBodyUnchanged);
}
void GrenadeController::EnterWorld(World *world, const Point3D& worldPosition)
{
OmniSource *source = new OmniSource("grenade/gun/Fire", 32.0F);
source->SetSourcePriority(kSoundPriorityWeapon);
source->SetNodePosition(worldPosition);
SetSourceVelocity(source);
world->AddNewNode(source);
}
void GrenadeController::Destroy(const Point3D& position, const Vector3D& normal)
{
GameWorld *world = static_cast<GameWorld *>(GetTargetNode()->GetWorld());
world->ProduceSplashDamage(position, kGrenadeSplashDamageRadius, 70, GetAttackerController());
TheMessageMgr->SendMessageAll(GrenadeExplodeMessage(GetControllerIndex(), position));
}
void GrenadeController::Bounce(void)
{
static const char soundName[2][32] =
{
"grenade/grenade/Bounce1", "grenade/grenade/Bounce2"
};
OmniSource *source = new OmniSource(soundName[Math::Random(2)], 64.0F);
source->SetSourcePriority(kSoundPriorityImpact);
source->SetNodePosition(GetFinalTransform().GetTranslation());
GetTargetNode()->GetWorld()->AddNewNode(source);
lifeTime = Min(lifeTime, 2000);
}
CreateGrenadeMessage::CreateGrenadeMessage() : CreateModelMessage(kModelMessageGrenade)
{
}
CreateGrenadeMessage::CreateGrenadeMessage(int32 projectileIndex, int32 characterIndex, const Point3D& position, const Vector3D& velocity) : CreateModelMessage(kModelMessageGrenade, projectileIndex, position)
{
initialVelocity = velocity;
attackerIndex = characterIndex;
}
CreateGrenadeMessage::~CreateGrenadeMessage()
{
}
void CreateGrenadeMessage::Compress(Compressor& data) const
{
CreateModelMessage::Compress(data);
data << initialVelocity;
data << attackerIndex;
}
bool CreateGrenadeMessage::Decompress(Decompressor& data)
{
if (CreateModelMessage::Decompress(data))
{
data >> initialVelocity;
data >> attackerIndex;
return (true);
}
return (false);
}
bool CreateGrenadeMessage::HandleMessage(Player *sender) const
{
GameWorld *world = static_cast<GameWorld *>(TheWorldMgr->GetWorld());
if (world)
{
Controller *controller = new GrenadeController(initialVelocity, static_cast<GameCharacterController *>(world->GetController(attackerIndex)));
InitializeModel(world, Model::Get(kModelGrenade), controller);
}
return (true);
}
GrenadeTeleportMessage::GrenadeTeleportMessage(int32 controllerIndex) : ControllerMessage(GrenadeController::kGrenadeMessageTeleport, controllerIndex)
{
}
GrenadeTeleportMessage::GrenadeTeleportMessage(int32 controllerIndex, const Point3D& position, const Vector3D& velocity, const Point3D& center) : ControllerMessage(GrenadeController::kGrenadeMessageTeleport, controllerIndex)
{
teleportPosition = position;
teleportVelocity = velocity;
effectCenter = center;
}
GrenadeTeleportMessage::~GrenadeTeleportMessage()
{
}
void GrenadeTeleportMessage::Compress(Compressor& data) const
{
ControllerMessage::Compress(data);
data << teleportPosition;
data << teleportVelocity;
data << effectCenter;
}
bool GrenadeTeleportMessage::Decompress(Decompressor& data)
{
if (ControllerMessage::Decompress(data))
{
data >> teleportPosition;
data >> teleportVelocity;
data >> effectCenter;
return (true);
}
return (false);
}
void GrenadeTeleportMessage::HandleControllerMessage(Controller *controller) const
{
GrenadeController *grenade = static_cast<GrenadeController *>(controller);
Transform4D teleportTransform = ProjectileController::CalculateProjectileTransform(teleportPosition, teleportVelocity);
grenade->Teleport(effectCenter, teleportTransform, teleportVelocity);
grenade->SetAngularVelocity(teleportTransform[0] * -2.0F);
}
GrenadeExplodeMessage::GrenadeExplodeMessage(int32 controllerIndex) : ControllerMessage(GrenadeController::kGrenadeMessageExplode, controllerIndex)
{
}
GrenadeExplodeMessage::GrenadeExplodeMessage(int32 controllerIndex, const Point3D& position) : ControllerMessage(GrenadeController::kGrenadeMessageExplode, controllerIndex)
{
explodePosition = position;
}
GrenadeExplodeMessage::~GrenadeExplodeMessage()
{
}
void GrenadeExplodeMessage::Compress(Compressor& data) const
{
ControllerMessage::Compress(data);
data << explodePosition;
}
bool GrenadeExplodeMessage::Decompress(Decompressor& data)
{
if (ControllerMessage::Decompress(data))
{
data >> explodePosition;
return (true);
}
return (false);
}
void GrenadeExplodeMessage::HandleControllerMessage(Controller *controller) const
{
MarkingData markingData;
Node *node = controller->GetTargetNode();
World *world = node->GetWorld();
OmniSource *source = new OmniSource("grenade/grenade/Explode", 256.0F);
OmniSourceObject *sourceObject = source->GetObject();
sourceObject->SetReflectionVolume(0.5F);
sourceObject->SetReflectionHFVolume(0.5F);
source->SetSourcePriority(kSoundPriorityExplosion);
source->SetNodePosition(explodePosition);
world->AddNewNode(source);
if (TheWorldMgr->GetLightDetailLevel() > 0)
{
ColorRGB color(4.0F, 2.0F, 0.4F);
PointLight *light = new PointLight(color, 10.0F);
if (TheWorldMgr->GetLightDetailLevel() < 3)
{
light->GetObject()->SetLightFlags(kLightShadowInhibit);
}
light->SetController(new FlashController(color, 0.5F, 1000));
light->SetNodePosition(explodePosition);
world->AddNewNode(light);
}
const Vector3D& velocity = static_cast<RigidBodyController *>(controller)->GetLinearVelocity();
GrenadeExplosionParticleSystem *grenadeExplosion = new GrenadeExplosionParticleSystem(velocity);
grenadeExplosion->SetNodePosition(explodePosition);
world->AddNewNode(grenadeExplosion);
GrenadeSparksParticleSystem *grenadeSparks = new GrenadeSparksParticleSystem(velocity);
grenadeSparks->SetNodePosition(explodePosition);
world->AddNewNode(grenadeSparks);
ShockwaveEffect *shockwave = new ShockwaveEffect("effects/Shock", 16.0F, 8.0F, 0.03125F);
shockwave->SetNodePosition(explodePosition);
world->AddNewNode(shockwave);
SphereField *field = new SphereField(Vector3D(6.0F, 6.0F, 6.0F));
field->SetNodePosition(explodePosition);
field->SetForce(new ExplosionForce(80.0F, kCollisionRemains | kCollisionShot));
field->SetController(new ExplosionController(250));
world->AddNewNode(field);
int32 t = Math::Random(256);
markingData.center = explodePosition;
markingData.normal = K::z_unit;
markingData.tangent.Set(Math::GetTrigTable()[t], 0.0F);
markingData.radius = 1.5F;
markingData.textureName = "texture/Scorch";
markingData.color.Set(0.0F, 0.0F, 0.0F, 1.0F);
markingData.lifeTime = 30000;
MarkingEffect::New(world, &markingData);
static_cast<GameWorld *>(world)->ShakeCamera(explodePosition, 0.06F, 1000);
delete node;
}
// ZYUQURM
| [
"twtravel@126.com"
] | twtravel@126.com |
63468a614f6be0ba93dd43e16ea0ffd1362bb44c | ad1cef9b834d0b46153a1d7e378faaa8b1fbcffb | /src/coordinator/interface/AbstractInstanceLink.h | ee0102c0ec6281028155e79d29dfe04eba344773 | [] | no_license | levy5307/FlySentinel | 7591a33e26bea88070e04ffef4c264e630dd1b6a | 10357bdc284a836297084bcc634c134831060e7e | refs/heads/master | 2020-05-15T23:08:02.022307 | 2019-08-04T06:34:36 | 2019-08-04T06:34:36 | 182,543,698 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,472 | h | //
// Created by levy on 2019/5/5.
//
#ifndef FLYSENTINEL_ABSTRACTINSTANCELINK_H
#define FLYSENTINEL_ABSTRACTINSTANCELINK_H
#include "../../asyncevent/convert.h"
class AbstractInstanceLink {
public:
virtual ~AbstractInstanceLink() {};
virtual void reset() = 0;
virtual void closeConnection(const std::shared_ptr<redisAsyncContext> context) = 0;
virtual const std::shared_ptr<redisAsyncContext> &getCommandContext() const = 0;
virtual const std::shared_ptr<redisAsyncContext> &getPubsubContext() const = 0;
virtual void decreasePendingCommands() = 0;
virtual void increasePendingCommands() = 0;
virtual int getPendingCommands() const = 0;
virtual void connectionError(const std::shared_ptr<redisAsyncContext> context) = 0;
virtual uint64_t getActPingTime() const = 0;
virtual void setActPingTime(uint64_t actPingTime) = 0;
virtual uint64_t getLastPingTime() const = 0;
virtual uint64_t getLastPongTime() const = 0;
virtual void setLastPongTime(uint64_t lastPongTime) = 0;
virtual void setLastPingTime(uint64_t lastPingTime) = 0;
virtual bool isDisconnected() const = 0;
virtual void setDisconnected(bool disconnected) = 0;
virtual uint64_t getPcLastActivity() const = 0;
virtual void setPcLastActivity(uint64_t pcLastActivity) = 0;
virtual uint64_t getLastAvailTime() const = 0;
virtual void setLastAvailTime(uint64_t lastAvailTime) = 0;
};
#endif //FLYSENTINEL_ABSTRACTINSTANCELINK_H
| [
"zlw5307@163.com"
] | zlw5307@163.com |
c2e83bf0431fa8cb189f8ecf9f2f3770e77674e4 | 122bc21c82956ed0d7b6c12892527f413dac1035 | /src/core/common/settings.cpp | 03a097675d9f50bb4d392e1e45420b6e640cd1ee | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | terious78/openthread | ee185ace96669a6f2da9d86e7b26633488d09ad8 | cc32575367c7f7f75ae8ecfe0d6482c51fcc9ed4 | refs/heads/master | 2020-12-24T10:11:32.137021 | 2016-10-26T16:10:17 | 2016-10-26T16:10:17 | 72,027,976 | 1 | 0 | null | 2016-10-26T17:36:53 | 2016-10-26T17:36:52 | null | UTF-8 | C++ | false | false | 13,826 | cpp | /*
* Copyright (c) 2016, The OpenThread Authors.
* 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.
*/
/**
* @file
* This file implements the OpenThread platform abstraction for non-volatile storage of settings.
*
*/
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <openthread-types.h>
#include <openthread-core-config.h>
#include <openthread-instance.h>
#include <common/code_utils.hpp>
#include <platform/settings.h>
#include <platform/flash.h>
#ifdef __cplusplus
extern "C" {
#endif
enum
{
kBlockAddBeginFlag = 0x1,
kBlockAddCompleteFlag = 0x02,
kBlockDeleteFlag = 0x04,
kBlockIndex0Flag = 0x08,
};
enum
{
kSettingsFlagSize = 4,
kSettingsBlockDataSize = 255,
kSettingsInSwap = 0xbe5cc5ef,
kSettingsInUse = 0xbe5cc5ee,
kSettingsNotUse = 0xbe5cc5ec,
};
OT_TOOL_PACKED_BEGIN
struct settingsBlock
{
uint16_t key;
uint16_t flag;
uint16_t length;
uint16_t reserved;
} OT_TOOL_PACKED_END;
static uint16_t getAlignLength(uint16_t length)
{
return (length + 3) & 0xfffc;
}
static void setSettingsFlag(uint32_t aBase, uint32_t aFlag)
{
otPlatFlashWrite(aBase, reinterpret_cast<uint8_t *>(&aFlag), sizeof(aFlag));
}
static void initSettings(uint32_t aBase, uint32_t aFlag)
{
uint32_t address = aBase;
uint32_t settingsSize = OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM > 1 ?
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE * OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM / 2 :
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE;
while (address < (aBase + settingsSize))
{
otPlatFlashErasePage(address);
otPlatFlashStatusWait(1000);
address += OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE;
}
setSettingsFlag(aBase, aFlag);
}
static uint32_t swapSettingsBlock(otInstance *aInstance)
{
uint32_t oldBase = aInstance->mSettingsBaseAddress;
uint32_t swapAddress = oldBase;
uint32_t usedSize = aInstance->mSettingsUsedSize;
uint8_t pageNum = OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM;
uint32_t settingsSize = pageNum > 1 ? OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE * pageNum / 2 :
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE;
VerifyOrExit(pageNum > 1, ;);
aInstance->mSettingsBaseAddress = (swapAddress == OPENTHREAD_CONFIG_SETTINGS_BASE_ADDRESS) ?
(swapAddress + settingsSize) :
OPENTHREAD_CONFIG_SETTINGS_BASE_ADDRESS;
initSettings(aInstance->mSettingsBaseAddress, static_cast<uint32_t>(kSettingsInSwap));
aInstance->mSettingsUsedSize = kSettingsFlagSize;
swapAddress += kSettingsFlagSize;
while (swapAddress < (oldBase + usedSize))
{
OT_TOOL_PACKED_BEGIN
struct addSettingsBlock
{
struct settingsBlock block;
uint8_t data[kSettingsBlockDataSize];
} OT_TOOL_PACKED_END addBlock;
bool valid = true;
otPlatFlashRead(swapAddress, reinterpret_cast<uint8_t *>(&addBlock.block), sizeof(struct settingsBlock));
swapAddress += sizeof(struct settingsBlock);
if (!(addBlock.block.flag & kBlockAddCompleteFlag) && (addBlock.block.flag & kBlockDeleteFlag))
{
uint32_t address = swapAddress + getAlignLength(addBlock.block.length);
while (address < (oldBase + usedSize))
{
struct settingsBlock block;
otPlatFlashRead(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
if (!(block.flag & kBlockAddCompleteFlag) && (block.flag & kBlockDeleteFlag) &&
!(block.flag & kBlockIndex0Flag) && (block.key == addBlock.block.key))
{
valid = false;
break;
}
address += (getAlignLength(block.length) + sizeof(struct settingsBlock));
}
if (valid)
{
otPlatFlashRead(swapAddress, addBlock.data, getAlignLength(addBlock.block.length));
otPlatFlashWrite(aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize,
reinterpret_cast<uint8_t *>(&addBlock),
getAlignLength(addBlock.block.length) + sizeof(struct settingsBlock));
aInstance->mSettingsUsedSize += (sizeof(struct settingsBlock) + getAlignLength(addBlock.block.length));
}
}
else if (addBlock.block.flag == 0xff)
{
break;
}
swapAddress += getAlignLength(addBlock.block.length);
}
setSettingsFlag(aInstance->mSettingsBaseAddress, static_cast<uint32_t>(kSettingsInUse));
setSettingsFlag(oldBase, static_cast<uint32_t>(kSettingsNotUse));
exit:
return settingsSize - aInstance->mSettingsUsedSize;
}
static ThreadError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0, const uint8_t *aValue,
uint16_t aValueLength)
{
ThreadError error = kThreadError_None;
OT_TOOL_PACKED_BEGIN
struct addSettingsBlock
{
struct settingsBlock block;
uint8_t data[kSettingsBlockDataSize];
} OT_TOOL_PACKED_END addBlock;
uint32_t settingsSize = OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM > 1 ?
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE * OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM / 2 :
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE;
addBlock.block.flag = 0xff;
addBlock.block.key = aKey;
if (aIndex0)
{
addBlock.block.flag &= (~kBlockIndex0Flag);
}
addBlock.block.flag &= (~kBlockAddBeginFlag);
addBlock.block.length = aValueLength;
if ((aInstance->mSettingsUsedSize + getAlignLength(addBlock.block.length) + sizeof(struct settingsBlock)) >=
settingsSize)
{
VerifyOrExit(swapSettingsBlock(aInstance) >= (getAlignLength(addBlock.block.length) + sizeof(struct settingsBlock)),
error = kThreadError_NoBufs);
}
otPlatFlashWrite(aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize,
reinterpret_cast<uint8_t *>(&addBlock.block),
sizeof(struct settingsBlock));
memset(addBlock.data, 0xff, kSettingsBlockDataSize);
memcpy(addBlock.data, aValue, addBlock.block.length);
otPlatFlashWrite(aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize + sizeof(struct settingsBlock),
reinterpret_cast<uint8_t *>(addBlock.data), getAlignLength(addBlock.block.length));
addBlock.block.flag &= (~kBlockAddCompleteFlag);
otPlatFlashWrite(aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize,
reinterpret_cast<uint8_t *>(&addBlock.block),
sizeof(struct settingsBlock));
aInstance->mSettingsUsedSize += (sizeof(struct settingsBlock) + getAlignLength(addBlock.block.length));
exit:
return error;
}
// settings API
void otPlatSettingsInit(otInstance *aInstance)
{
uint8_t index;
uint32_t settingsSize = OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM > 1 ?
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE * OPENTHREAD_CONFIG_SETTINGS_PAGE_NUM / 2 :
OPENTHREAD_CONFIG_SETTINGS_PAGE_SIZE;
aInstance->mSettingsBaseAddress = OPENTHREAD_CONFIG_SETTINGS_BASE_ADDRESS;
for (index = 0; index < 2; index++)
{
uint32_t blockFlag;
aInstance->mSettingsBaseAddress += settingsSize * index;
otPlatFlashRead(aInstance->mSettingsBaseAddress, reinterpret_cast<uint8_t *>(&blockFlag), sizeof(blockFlag));
if (blockFlag == kSettingsInUse)
{
break;
}
}
if (index == 2)
{
initSettings(aInstance->mSettingsBaseAddress, static_cast<uint32_t>(kSettingsInUse));
}
aInstance->mSettingsUsedSize = kSettingsFlagSize;
while (aInstance->mSettingsUsedSize < settingsSize)
{
struct settingsBlock block;
otPlatFlashRead(aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize,
reinterpret_cast<uint8_t *>(&block), sizeof(block));
if (!(block.flag & kBlockAddBeginFlag))
{
aInstance->mSettingsUsedSize += (getAlignLength(block.length) + sizeof(struct settingsBlock));
}
else
{
break;
}
}
}
ThreadError otPlatSettingsBeginChange(otInstance *aInstance)
{
(void)aInstance;
return kThreadError_None;
}
ThreadError otPlatSettingsCommitChange(otInstance *aInstance)
{
(void)aInstance;
return kThreadError_None;
}
ThreadError otPlatSettingsAbandonChange(otInstance *aInstance)
{
(void)aInstance;
return kThreadError_None;
}
ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
{
ThreadError error = kThreadError_NotFound;
uint32_t address = aInstance->mSettingsBaseAddress + kSettingsFlagSize;
int index = 0;
while (address < (aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize))
{
struct settingsBlock block;
otPlatFlashRead(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
if (block.key == aKey)
{
if (!(block.flag & kBlockIndex0Flag))
{
index = 0;
}
if (!(block.flag & kBlockAddCompleteFlag) && (block.flag & kBlockDeleteFlag))
{
if (index == aIndex)
{
error = kThreadError_None;
if (aValueLength)
{
*aValueLength = block.length;
}
if (aValue)
{
VerifyOrExit(aValueLength, error = kThreadError_InvalidArgs);
otPlatFlashRead(address + sizeof(struct settingsBlock), aValue, block.length);
}
}
index++;
}
}
address += (getAlignLength(block.length) + sizeof(struct settingsBlock));
}
exit:
return error;
}
ThreadError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
{
return addSetting(aInstance, aKey, true, aValue, aValueLength);
}
ThreadError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
{
uint16_t length;
bool index0;
index0 = (otPlatSettingsGet(aInstance, aKey, 0, NULL, &length) == kThreadError_NotFound ? true : false);
return addSetting(aInstance, aKey, index0, aValue, aValueLength);
}
ThreadError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
{
ThreadError error = kThreadError_NotFound;
uint32_t address = aInstance->mSettingsBaseAddress + kSettingsFlagSize;
int index = 0;
while (address < (aInstance->mSettingsBaseAddress + aInstance->mSettingsUsedSize))
{
struct settingsBlock block;
otPlatFlashRead(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
if (block.key == aKey)
{
if (!(block.flag & kBlockIndex0Flag))
{
index = 0;
}
if (!(block.flag & kBlockAddCompleteFlag) && (block.flag & kBlockDeleteFlag))
{
if (aIndex == index || aIndex == -1)
{
error = kThreadError_None;
block.flag &= (~kBlockDeleteFlag);
otPlatFlashWrite(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
}
if (index == 1 && aIndex == 0)
{
block.flag &= (~kBlockIndex0Flag);
otPlatFlashWrite(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
}
index++;
}
}
address += (getAlignLength(block.length) + sizeof(struct settingsBlock));
}
return error;
}
void otPlatSettingsWipe(otInstance *aInstance)
{
initSettings(aInstance->mSettingsBaseAddress, static_cast<uint32_t>(kSettingsInUse));
otPlatSettingsInit(aInstance);
}
#ifdef __cplusplus
};
#endif
| [
"jonhui@nestlabs.com"
] | jonhui@nestlabs.com |
3d296f3f9b782594ecd080ad7e12b8e104fdd7b8 | 11c74b57455ce2454849fbe9a73a2e0d2a3542d2 | /contests/2018杭电/2018 Multi-University Training Contest 6/B.cpp | 651bd249a4c978fee39800027c4134d401347644 | [] | no_license | heyuhhh/ACM | 4fe0239b7f55a62db5bc47aaf086e187134fb7e6 | e1ea34686b41a6c5b3f395dd9c76472220e9db5d | refs/heads/master | 2021-06-25T03:59:51.580876 | 2021-04-27T07:22:51 | 2021-04-27T07:22:51 | 223,877,467 | 9 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,516 | cpp | /*
* Author: heyuhhh
* Created Time: 2020/5/15 20:46:04
*/
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <assert.h>
#define MP make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define INF 0x3f3f3f3f
#define Local
#ifdef Local
#define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
void err() { std::cout << std::endl; }
template<typename T, typename...Args>
void err(T a, Args...args) { std::cout << a << ' '; err(args...); }
template <template<typename...> class T, typename t, typename... A>
void err(const T <t> &arg, const A&... args) {
for (auto &v : arg) std::cout << v << ' '; err(args...); }
#else
#define dbg(...)
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//head
const int N = 2e6 + 5, MOD = 1e9 + 7;
int qpow(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1) res = res * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return res;
}
int fib[N], fac[N], inv[N];
void init() {
fib[0] = 0, fib[1] = 1;
for (int i = 2; i < N; i++) {
fib[i] = (fib[i - 1] + fib[i - 2]) % (MOD - 1);
}
fac[0] = 1;
for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % MOD;
inv[N - 1] = qpow(fac[N - 1], MOD - 2);
for (int i = N - 2; i >= 0; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % MOD;
}
int C(int n, int m) {
return 1ll * fac[n] * inv[m] % MOD * inv[n - m] % MOD;
}
int n, k;
int f[N];
void run() {
cin >> n >> k;
int tot = C(n + k - 1, k - 1);
int ans = 0;
vector <int> d;
for (int i = 1; i <= n; i++) {
if (n % i == 0) {
d.push_back(i);
f[i] = C(n / i + k - 1, k - 1);
}
}
for (int i = sz(d) - 1; i >= 0; i--) {
for (int j = i + 1; j < sz(d); j++) {
if (d[j] % d[i] == 0) {
f[d[i]] = (f[d[i]] - f[d[j]] + MOD) % MOD;
}
}
}
for (auto it : d) {
ans = (ans + 1ll * f[it] * (qpow(2, fib[it] % (MOD - 1)) - 1 + MOD) % MOD) % MOD;
}
ans = 1ll * ans * qpow(tot, MOD - 2) % MOD;
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cout << fixed << setprecision(20);
init();
int T; cin >> T; while(T--)
run();
return 0;
}
| [
"2468861298@qq.com"
] | 2468861298@qq.com |
db2087c9beadfa9072912166d6bd1e6789f46fd0 | 814f87efd427c6da3ebaf7bd253afe708b42692d | /lineagehw/hidl/touch/GloveMode.cpp | 1fce76bce429f2e558c0260b6811994026f82e43 | [] | no_license | Andrei-Tanase/android_device_huawei_kirin970-common | 9b21a1942b137cd172008e86f50b88da0737ef3b | bbac1660339c147e0fc2d06d678b79a7cae69e3f | refs/heads/master | 2022-09-24T08:35:46.551965 | 2019-10-14T20:29:59 | 2019-10-14T20:29:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,326 | cpp | /*
* Copyright (C) 2019 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "GloveMode.h"
#include <fstream>
namespace vendor {
namespace lineage {
namespace touch {
namespace V1_0 {
namespace kirin970 {
static constexpr const char *kTouchGlovePath = "/sys/touchscreen/touch_glove";
// Methods from ::vendor::lineage::touch::V1_0::IGloveMode follow.
Return<bool> GloveMode::isEnabled() {
std::ifstream file(kTouchGlovePath);
int result;
file >> result;
return !file.fail() && result > 0;
}
Return<bool> GloveMode::setEnabled(bool enabled) {
std::ofstream file(kTouchGlovePath);
file << (enabled ? "1" : "0");
return !file.fail();
}
} // namespace kirin970
} // namespace V1_0
} // namespace touch
} // namespace lineage
} // namespace vendor
| [
"xtutorials161@gmail.com"
] | xtutorials161@gmail.com |
371841c19530d21ed70689cc3c963b9c99edb840 | ba4db75b9d1f08c6334bf7b621783759cd3209c7 | /src_main/sdktools/xsi/5.1/SMDExportCPP/StdAfx.cpp | 987e3d9149519c2ba7490af3557f026ec170dc1e | [] | no_license | equalent/source-2007 | a27326c6eb1e63899e3b77da57f23b79637060c0 | d07be8d02519ff5c902e1eb6430e028e1b302c8b | refs/heads/master | 2020-03-28T22:46:44.606988 | 2017-03-27T18:05:57 | 2017-03-27T18:05:57 | 149,257,460 | 2 | 0 | null | 2018-09-18T08:52:10 | 2018-09-18T08:52:09 | null | UTF-8 | C++ | false | false | 296 | cpp | // stdafx.cpp : source file that includes just the standard includes
// SMDExport.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
| [
"sean@csnxs.uk"
] | sean@csnxs.uk |
6d77f0d42edbc118955d89ae790b0b7fd9e526b0 | fa867141bb96a4c545af4ff6faa15c2ee7816ad2 | /dank-twitter-backend/image_processing.cpp | 5393851a66240829d23907eaff05b31ff99e843f | [] | no_license | brotheroftux/dank-twitter-memes | 5b13831a338c003aae4d11b84c00794b0d12e781 | e5c2cf5d7deb7e8c061147b9365fb361009d754f | refs/heads/master | 2021-05-15T02:41:41.024300 | 2017-12-14T23:44:17 | 2017-12-14T23:44:17 | 106,198,471 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 380 | cpp | #include "image_processing.h"
Mat process_grayscale (const Mat & input) {
Mat destination;
resize(input, destination, Size(), 3, 3);
return destination;
}
string convert_to_blob (const Mat & input) {
vector<unsigned char> data;
imencode(".png", input, data);
string body_data(data.begin(), data.end());
return body_data;
}
| [
"afc2008@yandex.ru"
] | afc2008@yandex.ru |
37ed61f3e2327fae8093a6da790e1c18f52aabc3 | 4a4f8d670e727fff8dbcf1166bf8e0eba47d5ad8 | /Mouse_house/Time.cpp | be2cfaba787721addba4fd351a382f208d540f4e | [] | no_license | JiekangHuang/Arduino | 9278c3f52e54826a8cab65227032c66c5b582470 | 496ebb76e3ee55c8302b50a62c3c99c9095362e6 | refs/heads/master | 2020-05-18T11:38:43.170904 | 2019-12-28T01:16:40 | 2019-12-28T01:16:40 | 184,381,377 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 367 | cpp | #include "Time.h"
Time::Time(LiquidCrystal_I2C* lcd)
{
this->_lcd = lcd;
}
Time::~Time()
{
}
void Time::time_begin()
{
this->_lcd->setCursor(0, 1);
this->_lcd->print("boot time>");
this->_lcd->setCursor(15, 1);
this->_lcd->print("m");
}
void Time::show_time()
{
boot_time = millis() / 1000 / 60;
this->_lcd->setCursor(10, 1);
this->_lcd->print(boot_time);
} | [
"90618143@gcloud.csu.edu.tw"
] | 90618143@gcloud.csu.edu.tw |
65857afb5cce9cf0e077f8a47766074239f5b6ed | b389f1f3075092f7cb25f45ee9bf910c55250735 | /WorkInProgress/AtCoder - AtCoder Beginner Contest 214/C - Distribution/main.cpp | 50e6b0a0d1d701aa62a6ff3e13414bc634214d35 | [] | no_license | leostd/Competitive-Programming | 7b3c4c671e799216c79aeefd2ca7d68c5d463fa6 | 4db01b81314f82c4ebb750310e5afb4894b582bd | refs/heads/master | 2023-05-13T07:04:40.512100 | 2023-05-06T10:58:28 | 2023-05-06T10:58:28 | 87,685,033 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,266 | cpp | #pragma GCC diagnostic ignored "-Wunused-const-variable"
#ifdef MAC
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <chrono>
#include <complex>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define mp make_pair
#define pb push_back
#define forn(i, n) for(int i = 0; i < (int)(n); ++i)
#define for1(i, n) for(int i = 1; i < (int)(n); ++i)
#define nfor(i, n) for(int i = int(n) - 1; i >= 0; --i)
#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
#define correct(x, y, n, m) (0 <= x && x < n && 0 <= y && y < m)
#define all(x) (x).begin(), (x).end()
#define fst first
#define snd second
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef tuple<int,int,int> iii;
template<typename T> inline T abs(T a){ return ((a < 0) ? -a : a); }
template<typename T> inline T sqr(T a){ return a * a; }
template<class T> T gcd(T a, T b) { return a ? gcd (b % a, a) : b; }
template<class T> T lcm(T a, T b) { return a / gcd (a, b) * b; }
template<class T> T sign(T a) { return a > 0 ? 1 : (a < 0 ? -1 : 0); }
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(bool b) {
return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
bool first = true;
string res = "{";
for (const auto &x : v) {
if (!first) {
res += ", ";
}
first = false;
res += to_string(x);
}
res += "}";
return res;
}
void dbg() { cout << endl; }
template <typename Head, typename... Tail>
void dbg(Head H, Tail... T) {
cout << " " << to_string(H);
dbg(T...);
}
#ifdef DEBUG
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg(__VA_ARGS__)
#else
#define dbg(...)
#endif
void fastIO() {
cin.sync_with_stdio(false);
cin.tie(0);
}
template<typename T>
vector<T> make_unique(vector<T> v) {
sort(all(v));
return v.resize(unique(all(v)) - v.begin());
}
int nxt() {
int x;
cin >> x;
return x;
}
const int dx[4] = {0, 0, 1, -1};
const int dy[4] = {1, -1, 0, 0};
const int dxKn[8] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int dyKn[8] = { 1, 2, 2, 1, -1, -2, -2, -1};
const int dxK[8] = {0, 0, 1, -1, 1, 1, -1, -1};
const int dyK[8] = {1, -1, 0, 0, 1, -1, 1, -1};
const int MOD = int(1e9) + 7;
const int INF = int(1e9) + 100;
const ll INF64 = 2e18;
const ld PI = ld(3.1415926535897932384626433832795);
const ld e = ld(2.7182818284590452353602874713527);
const ld EPS = 1e-9;
//#############################
const int MAXN = 1000005;
int n, m; // sizes
vector<vector<int>> g; //graph, grid
int main() {
fastIO();
cin >> n;
vector<int> t(n, 0), s(n, 0);
priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> pq;
int mn = INF;
forn(i, n) cin >> s[i];
forn(i, n) cin >> t[i], pq.push({t[i], i});
set<int> visited;
vector<int> vt(n, INF);
while(visited.size() < n) {
// dbg(pq);
vector<int> a = pq.top();
pq.pop();
int curi = a[1];
int curt = a[0];
visited.insert(curi);
vt[curi] = min(vt[curi], curt);
pq.push({curt+s[curi], (curi+1)%n});
}
forn(i, n) {
cout << vt[i] << endl;
}
return 0;
}
/*
RECALL CORNER CASES - e.g. n = 1, n = 0
WRITE SOME STUFF
think first, always -
1. concretely
2. graphically
3. abstractly
4. algebraically
Checklist:
- I/O make sense? - Exclusion/inclusion - Is a known sequence?
- Reverse - Brute force approach - DP
- Sort input - Greedy approach
- Check diagonals - Divide and Conquer approach
*/ | [
"leocaracas2010@gmail.com"
] | leocaracas2010@gmail.com |
ad49af912ebf25dd0ccf72b5501462c3e65e775a | baa1ae2afa8968d726f8cfd12135f8f9b691832e | /code/game-pacman/src/entities/Entity.cpp | 2ca51aae9bd3ff8dc8d14dd74c289ef6b229faf4 | [] | no_license | germix/germix-games | ffaf1ebb360c389463a7438ee3c6cc33b031280c | db315cd54f06a7a646bc6789b9651ef39816643d | refs/heads/master | 2022-04-05T07:32:56.040835 | 2019-11-19T11:06:03 | 2019-11-19T11:06:03 | 222,627,542 | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 711 | cpp | ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Entity
//
// Germán Martínez
//
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <src/entities/Entity.h>
#include <src/Scene.h>
bool Entity::move(DIRECTION dir, unsigned int mask, const Rectangle& rect)
{
int dx = 0;
int dy = 0;
switch(dir)
{
case DIRECTION_UP: dy = -1; break;
case DIRECTION_DOWN: dy = +1; break;
case DIRECTION_LEFT: dx = -1; break;
case DIRECTION_RIGHT: dx = +1; break;
default: return false;
}
if(scene->tryMove(rect, dx, dy, mask))
{
x += dx;
y += dy;
return true;
}
return false;
}
| [
"german.m7186@gmail.com"
] | german.m7186@gmail.com |
d0e743d0a64f1a068b3023bedd593d145f9adbea | 9d851f5315bce6e24c8adcf6d2d2b834f288d2b2 | /chipyard/tools/chisel3/test_run_dir/MixedVecIOTester/2020030621363812072604576794274245/VMixedVecIOTester__Trace__Slow.cpp | f43cf5c18638e7d1dc00dc88902fc89b78b584af | [
"BSD-3-Clause"
] | permissive | ajis01/systolicMM | b9830b4b00cb7f68d49fb039a5a53c04dcaf3e60 | d444d0b8cae525501911e8d3c8ad76dac7fb445c | refs/heads/master | 2021-08-17T22:54:34.204694 | 2020-03-18T03:31:59 | 2020-03-18T03:31:59 | 247,648,431 | 0 | 1 | null | 2021-03-29T22:26:24 | 2020-03-16T08:27:34 | C++ | UTF-8 | C++ | false | false | 3,067 | cpp | // Verilated -*- C++ -*-
// DESCRIPTION: Verilator output: Tracing implementation internals
#include "verilated_vcd_c.h"
#include "VMixedVecIOTester__Syms.h"
//======================
void VMixedVecIOTester::trace (VerilatedVcdC* tfp, int, int) {
tfp->spTrace()->addCallback (&VMixedVecIOTester::traceInit, &VMixedVecIOTester::traceFull, &VMixedVecIOTester::traceChg, this);
}
void VMixedVecIOTester::traceInit(VerilatedVcd* vcdp, void* userthis, uint32_t code) {
// Callback from vcd->open()
VMixedVecIOTester* t=(VMixedVecIOTester*)userthis;
VMixedVecIOTester__Syms* __restrict vlSymsp = t->__VlSymsp; // Setup global symbol table
if (!Verilated::calcUnusedSigs()) VL_FATAL_MT(__FILE__,__LINE__,__FILE__,"Turning on wave traces requires Verilated::traceEverOn(true) call before time 0.");
vcdp->scopeEscape(' ');
t->traceInitThis (vlSymsp, vcdp, code);
vcdp->scopeEscape('.');
}
void VMixedVecIOTester::traceFull(VerilatedVcd* vcdp, void* userthis, uint32_t code) {
// Callback from vcd->dump()
VMixedVecIOTester* t=(VMixedVecIOTester*)userthis;
VMixedVecIOTester__Syms* __restrict vlSymsp = t->__VlSymsp; // Setup global symbol table
t->traceFullThis (vlSymsp, vcdp, code);
}
//======================
void VMixedVecIOTester::traceInitThis(VMixedVecIOTester__Syms* __restrict vlSymsp, VerilatedVcd* vcdp, uint32_t code) {
VMixedVecIOTester* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
int c=code;
if (0 && vcdp && c) {} // Prevent unused
vcdp->module(vlSymsp->name()); // Setup signal names
// Body
{
vlTOPp->traceInitThis__1(vlSymsp, vcdp, code);
}
}
void VMixedVecIOTester::traceFullThis(VMixedVecIOTester__Syms* __restrict vlSymsp, VerilatedVcd* vcdp, uint32_t code) {
VMixedVecIOTester* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
int c=code;
if (0 && vcdp && c) {} // Prevent unused
// Body
{
vlTOPp->traceFullThis__1(vlSymsp, vcdp, code);
}
// Final
vlTOPp->__Vm_traceActivity = 0U;
}
void VMixedVecIOTester::traceInitThis__1(VMixedVecIOTester__Syms* __restrict vlSymsp, VerilatedVcd* vcdp, uint32_t code) {
VMixedVecIOTester* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
int c=code;
if (0 && vcdp && c) {} // Prevent unused
// Body
{
vcdp->declBit (c+1,"clock",-1);
vcdp->declBit (c+2,"reset",-1);
vcdp->declBit (c+1,"MixedVecIOTester clock",-1);
vcdp->declBit (c+2,"MixedVecIOTester reset",-1);
// Tracing: MixedVecIOTester _T_33 // Ignored: Inlined leading underscore at /home/ajis01/scratch/CS252A_Project/chipyard/tools/chisel3/test_run_dir/MixedVecIOTester/2020030621363812072604576794274245/MixedVecIOTester.v:5
}
}
void VMixedVecIOTester::traceFullThis__1(VMixedVecIOTester__Syms* __restrict vlSymsp, VerilatedVcd* vcdp, uint32_t code) {
VMixedVecIOTester* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
int c=code;
if (0 && vcdp && c) {} // Prevent unused
// Body
{
vcdp->fullBit (c+1,(vlTOPp->clock));
vcdp->fullBit (c+2,(vlTOPp->reset));
}
}
| [
"ajithkumar.sreekumar94@gmail.com"
] | ajithkumar.sreekumar94@gmail.com |
76fecd6450dd760b0b87d4cb73c80c891ccfe838 | 4bd16eeaf3112ec176617d6f841d74b3c7ada879 | /trees/trees/trees.cpp | 3257df6c62afa504fad92629bc474d465b5c0e44 | [] | no_license | sowjanya1998/sowjanya | e751a54565c959b9b0852601d790cf007b3acca0 | 01e9ee139fb230982cc3d04d295f89114d416fb5 | refs/heads/master | 2020-04-21T16:46:55.960247 | 2019-03-18T15:15:55 | 2019-03-18T15:15:55 | 169,713,613 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,481 | cpp | #include<iostream>
#include<math.h>
#include<algorithm>
//#define _max(a,b) (((a)>(b)) :a ?b)
using namespace std;
struct node
{
int data;
node *left, *right;
};
class tree
{
struct node *root;
public:
tree()
{
root = NULL;
//root->left = NULL;
// root->right = NULL;
}
void buildtree()
{
int num, i,del;
cout << "enter no of node"<<endl;
cin >> num;
int *arr;
arr = new int[num];
for (i = 0; i < num; i++)
cin >> arr[i];
for (i = 0; i < num; i++)
root = insert(arr[i],root);
cout << "enter node to delete" << endl;
cin >> del;
root = deletenode(del,root);
inorder(root);
getchar();
}
node* insert(int e, struct node *curr)
{
if (curr == NULL)
{
struct node*temp;
temp = new struct node;
temp->data = e;
temp->left = NULL;
temp->right = NULL;
curr = temp;
}
else
{
if (e < curr->data)
curr->left = insert(e, curr->left);
else
curr->right = insert(e, curr->right);
}
return curr;
}
int findmax(struct node *curr)
{
if (curr->right == NULL)
return curr->data;
findmax(curr->right);
}
int findmin(struct node *curr)
{
if (curr->left == NULL)
return curr->data;
findmin(curr->left);
}
int height(node *curr)
{
if (curr == NULL)
return -1;
return(std::max(height(curr->left), height(curr->right)));
}
struct node* deletenode(int ele, node *curr)
{
if (ele < curr->data)
curr->left=deletenode(ele,curr->left);
else if (ele > curr->data)
curr->right=deletenode(ele,curr->right);
else
{
//struct node *curr = curr;
if (curr->left == NULL && curr->right == NULL) {
delete curr;
return NULL;
}
else if (curr->left == NULL && curr->right != NULL)
curr = curr->right;
else if (curr->right == NULL && curr->left != NULL)
curr = curr->left;
else
{
curr->data = findmax(curr->left);
curr->left=deletenode(curr->data, curr->left);
}
}
return curr;
}
void inorder(node *curr)
{
if (curr == NULL)
return;
else {
inorder(curr->left);
cout << curr->data << endl;
inorder(curr->right);
}
}
void preorder(node *curr)
{
if (curr == NULL)
return;
else {
cout << curr->data << endl;
preorder(curr->left);
preorder(curr->right);
}
}
void postorder(node *curr)
{
if (curr == NULL)
return;
else {
postorder(curr->left);
postorder(curr->right);
cout << curr->data << endl;
}
}
};
int main()
{
tree t1;
t1.buildtree();
getchar();
} | [
"sowjanyadarna@gmail.com"
] | sowjanyadarna@gmail.com |
ea153f0b04c94c4b394e2b465116782d2e24aa47 | f942a17cbb3421407073ffd749d2ff7ba13b2895 | /src/args.h | 32cc2c67440c2d8d86cabdda67bb7acfded6c4aa | [
"BSD-3-Clause"
] | permissive | guoqunabc/fastText-PV | 2b4d20dba0b48c7c3cabf0dfc17664ec6aac49f1 | dea3bb2ab9645ea595e7a0a02d1a507180c08469 | refs/heads/master | 2020-06-07T12:45:04.593119 | 2018-05-09T02:21:02 | 2018-05-09T02:21:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,454 | h | /**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifndef FASTTEXT_ARGS_H
#define FASTTEXT_ARGS_H
#include <istream>
#include <ostream>
#include <string>
#include <vector>
namespace fasttext {
enum class model_name : int {cbow=1, sg, rsg, sup, PVDM, PVDBOW};
enum class loss_name : int {hs=1, ns, softmax};
class Args {
private:
std::string lossToString(loss_name);
public:
Args();
std::string input;
std::string test;
std::string output;
double lr;
int lrUpdateRate;
int dim;
int ws;
int epoch;
int minCount;
int minCountLabel;
int neg;
int wordNgrams;
loss_name loss;
model_name model;
int bucket;
int minn;
int maxn;
int thread;
double t;
std::string label;
int verbose;
std::string pretrainedVectors;
int saveOutput;
bool qout;
bool retrain;
bool qnorm;
size_t cutoff;
size_t dsub;
void parseArgs(const std::vector<std::string>& args);
void printHelp();
void printBasicHelp();
void printDictionaryHelp();
void printTrainingHelp();
void printQuantizationHelp();
void save(std::ostream&);
void load(std::istream&);
};
}
#endif
| [
"weiwei@thunisoft.com"
] | weiwei@thunisoft.com |
f4c876028738ba393f87ad892706dbe297214467 | 580930f6a60ad4e494dfcf7797dff0b30f3b7c6f | /Classes/HUDLayer.cpp | f57a7ef101e6ec25bb3b4c4fa1d8f3a2dc75cf69 | [] | no_license | TheWindShan/Blocks | 9131082612e58258ab5136eebd3ee63e363ec565 | e4d33ef2f0137441d3ac97585268e44ccc83e30a | refs/heads/master | 2021-01-18T07:22:28.440010 | 2016-05-10T15:43:00 | 2016-05-10T15:43:00 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,799 | cpp | #include "HUDLayer.h"
bool HUDLayer::init()
{
if (!Layer::init())
{
return false;
}
addLayer();
return true;
}
HUDLayer::HUDLayer()
{
lineNum = 0;
comboNum = 0;
scoreNum = 0;
}
HUDLayer::~HUDLayer()
{
removeAllChildrenWithCleanup(true);
removeFromParentAndCleanup(true);
}
void HUDLayer::addLayer()
{
Point originPoint = Director::getInstance()->getVisibleOrigin();
Size visibleSize = Director::getInstance()->getVisibleSize();
this->setAnchorPoint(Point(0.5, 0.5));
this->ignoreAnchorPointForPosition(false);
this->setPosition(Point(originPoint.x + visibleSize.width / 2, originPoint.y + visibleSize.height / 2));
Node *rootNode = CSLoader::createNode("scoreNode.csb");
rootNode->setAnchorPoint(Point::ZERO);
//rootNode->setPosition(Point(originPoint.x + visibleSize.width / 2, originPoint.y + visibleSize.height / 2));
this->addChild(rootNode);
auto hudRoot = dynamic_cast<Node*>(rootNode->getChildByName("hudRoot"));
auto hud = dynamic_cast<Node*>(hudRoot->getChildByName("hudNode"));
curLine = dynamic_cast<Text*>(hud->getChildByName("textCurLine"));
curScore = dynamic_cast<Text*>(hud->getChildByName("textCurScore"));
curSpeed = dynamic_cast<Text*>(hud->getChildByName("textCurSpeed"));
curCombo = dynamic_cast<Text*>(hud->getChildByName("textCurCombo"));
curSpeed->setText(String::createWithFormat("%d", CommandCenter::getInstance()->getSpeedLevel())->getCString());
}
void HUDLayer::addLine(int add_line)
{
int combo = add_line - 1;
int tem = lineNum;
lineNum += add_line;
if (tem % 20 > lineNum % 20)
{
this->addSpeed();
}
curLine->setText(String::createWithFormat("%d", lineNum)->getCString());
Vector<FiniteTimeAction*> vector_action;
for (int i = 0; i < combo; i++)
{
auto action = Sequence::create(CCCallFunc::create(CC_CALLBACK_0(HUDLayer::addCombo, this)), DelayTime::create(0.1f / add_line), nullptr);
vector_action.pushBack(action);
}
//几次combo就几倍积分
for (int i = 0; i < add_line * add_line; i++)
{
auto action = Sequence::create(CCCallFunc::create(CC_CALLBACK_0(HUDLayer::addScore, this)), DelayTime::create(0.1f / (add_line * add_line)), nullptr);
vector_action.pushBack(action);
}
auto action = Sequence::create(vector_action);
this->runAction(action);
}
void HUDLayer::addCombo()
{
comboNum += 1;
curCombo->setText(String::createWithFormat("%d", comboNum)->getCString());
}
void HUDLayer::addScore()
{
//每次10分
DiscJockey::getInstance()->playAddScoreEffect();
scoreNum += 10;
curScore->setText(String::createWithFormat("%d", scoreNum)->getCString());
}
void HUDLayer::addSpeed()
{
int speed = CommandCenter::getInstance()->getSpeedLevel() + 1;
CommandCenter::getInstance()->setSpeedLevel(speed);
curSpeed->setText(String::createWithFormat("%d", speed)->getCString());
} | [
"hitlolo@qq.com"
] | hitlolo@qq.com |
c5558b5681728b7266d5cc0992a58c0787896fa9 | 4e9666aad3c00f5881e2200def326833af0c21db | /BootCamp/B-Ringo'sFavoriteNumbers.cpp | 2ec78bcb163b58c384831a7b4085b35059667789 | [] | no_license | kumokumo1653/Atcoder | 31ff3fc946aa61750c5c70066c59fc0be453f88d | 01850e381ccc1e7ce7f6c500329b072e779ffaca | refs/heads/master | 2022-12-23T09:16:05.153731 | 2022-12-17T06:05:52 | 2022-12-17T06:05:52 | 245,761,692 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,054 | cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i,m,n) for(int i = m - 1; i >= n; i--)
#define ALL(v) v.begin(), v.end()
#define itn int
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define YES() cout << "YES" << endl
#define NO() cout << "NO" << endl
#define println(x) cout << x << endl
#define print(x) cout << x << " "
template<typename T, typename U>
inline bool CMAX(T &m, U x) { if (m < x) { m = x; return true; } return false; }
template<typename T, typename U>
inline bool CMIN(T &m, U x) { if (m > x) { m = x; return true; } return false; }
typedef long long lint;
typedef long double ldouble;
const int INF = 1e9;
const lint LINF = 1e18;
const int MOD = 1e9+7;
int main(){
int d,n;
cin >>d >> n;
int ans = 1;
REP(i,d){
ans *= 100;
}
if(n == 100){
println(ans * (n + 1));
}else
println(ans * n);
return 0;
} | [
"fjsda526hdbs@gmail.com"
] | fjsda526hdbs@gmail.com |
ba0b17d85d4a4335ff2174048ab19d987cbc3073 | 2f6f4953d35e53d3d86ad4e959d9f032d4bb3c4c | /startalk_ui/imageviewer.cpp | beef8cbf2ee755f96fcdf0c1c25393cffc5f8a79 | [
"MIT"
] | permissive | xuepingiw/open_source_startalk | c9b6866b736d51798394486de2b6181a49f38466 | 44d962b04039f5660ec47a10313876a0754d3e72 | refs/heads/master | 2020-04-29T03:00:00.190179 | 2019-03-27T07:01:40 | 2019-03-27T07:01:40 | 175,791,902 | 0 | 0 | MIT | 2019-03-15T09:43:22 | 2019-03-15T09:43:18 | null | UTF-8 | C++ | false | false | 29,538 | cpp | #include "imageviewer.h"
#include <QDesktopWidget>
#include <QApplication>
#include <QPoint>
#include <QWheelEvent>
#include <QMessageBox>
#include <QUrl>
#include <QDir>
#include <QDesktopServices>
#include <QMovie>
#include "ConfigureHelper.h"
#include "Session.h"
#include "Account.h"
#include "AccountData.h"
#include <QFileDialog>
#include <QImageReader>
#include "BizCallback.h"
#include "attachmentmanager.h"
#include "UtilHelper.h"
#include "diywidgit/customviews/qframelayout.h"
#include "portraithelper.h"
#include "ImageHelper.h"
ImageViewer::ImageViewer(QWidget *parent)
: LocalManWidget(parent),scaleTick(1.2),maxRate(16),minRate(0.05),imagePressed(false),picIndexTimeLine(new QTimeLine(700)),bScaleable(false)
, mGifPlayer(new QMovie(this)), bFirst(true), bresize(false)
{
ui.setupUi(this);
using namespace Qt;
auto remove = WindowTitleHint;
auto add = FramelessWindowHint | WindowMinMaxButtonsHint | Tool;
setAttribute(Qt::WA_AlwaysShowToolTips, true);
setAttribute(Qt::WA_TranslucentBackground, true);
overrideWindowFlags( (Qt::WindowFlags)((windowFlags() & ~remove) | add));
#ifdef QCHAT
setWindowIcon(QIcon(":/Images/Deal_chat.ico"));
#else
setWindowIcon(QIcon(":/Images/Deal.ico"));
#endif
setWindowTitle(QStringLiteral("图片查看器"));
connect(ui.btnClose,&QPushButton::clicked,this,&ImageViewer::onClose);
QDesktopWidget* desktopWidget = QApplication::desktop();
screenRect = desktopWidget->screenGeometry();
minSize = QSize(screenRect.width()/3,screenRect.height()/3);
maxSize = QSize(screenRect.width()-100,screenRect.height()-100);
connect(picIndexTimeLine,&QTimeLine::finished,[this]{
ui.ratetext->setVisible(false);
});
connect(ui.pre,&QPushButton::clicked,[this](bool bcheck){
showPrePicture();
});
connect(ui.next,&QPushButton::clicked,[this](bool bcheck){
showNextPicture();
});
connect(ui.normalsize,&QPushButton::clicked,[this](bool bcheck){
scaledRate = 1.0;
_scaledSize();
});
connect(ui.openfolder,&QPushButton::clicked,[this](bool bcheck){
QString folder = currentFile;
int pos = folder.lastIndexOf('\\');
if(-1==pos)
pos = folder.lastIndexOf("/");
folder = folder.left(pos);
QDir dir(folder);
if(dir.exists())
{
QDesktopServices::openUrl(QUrl("file:///"+folder, QUrl::TolerantMode));
}
});
connect(ui.smaller,&QPushButton::clicked,[this](bool bcheck){
onScrollSize(-1);
});
connect(ui.bigger,&QPushButton::clicked,[this](bool bcheck){
onScrollSize(1);
});
connect(ui.turnright, &QPushButton::clicked,[this]{
QMatrix matrix;
matrix.rotate(90);
rawPixmap = rawPixmap.transformed(matrix);
_scaledSize();
});
connect(ui.saveas,&QPushButton::clicked,[this](bool bcheck){
if (!currentFile.isEmpty())
{
//QString localPath = Biz::ConfigureHelper::UserTempPath(Biz::Session::currentAccount().accountData().UserID());
QString localPath = Biz::ConfigureHelper::getDeskWindowPath();
localPath.replace("/","\\");//将地址中的"/"替换为"\",因为在Windows下使用的是"\"。
//QString localFileName = localPath + fileName;
QFileInfo fileIfor(currentFile);
QString localFileName = localPath + fileIfor.fileName();
QString strextername = fileIfor.suffix();
QString suffixname;
if (!strextername.isEmpty())
{
suffixname = QString("Images (*.%1)").arg(strextername);
}
else
suffixname = "Images (*.png *.xpm *.jpg)";
QString saveFileName = QFileDialog::getSaveFileName(0, "", localFileName, suffixname);
if (!saveFileName.isEmpty())
{
UtilHelper::copyFileToPath(currentFile, saveFileName, true);
}
}
});
QFrameLayout* pLayoutBk2 = new QFrameLayout(ui.bk2);
pLayoutBk2->appendWidget(ui.bk,ALINE_FILL);
QFrameLayout* pLayout1 = new QFrameLayout(ui.bk);
pLayout1->appendWidget(ui.webRemoteUrl,ALINE_FILL);
pLayout1->appendWidget(ui.btnClose,ALINE_TOP|ALINE_RIGHT,QMargins(0,10,10,0));
pLayout1->appendWidget(ui.boolbar,ALINE_BOTTOM|ALINE_HCENTER);
pLayout1->appendWidget(ui.miniview,ALINE_RIGHT|ALINE_BOTTOM);
pLayout1->appendWidget(ui.next,ALINE_VCENTER|ALINE_RIGHT);
pLayout1->appendWidget(ui.pre,ALINE_VCENTER|ALINE_LEFT);
pLayout1->appendWidget(ui.ratetext,ALINE_VCENTER|ALINE_HCENTER);
ui.miniview->installEventFilter(this);
this->installEventFilter(this);
this->setSizeGripEnabled(true);
}
ImageViewer::~ImageViewer()
{
}
void ImageViewer::showPicture(const QString& path, const QString& fileId)
{
Log::e(QString("ImageViewer::showPicture %1").arg(path));
resetSizeLimited();
QString pixPath = path;
if (QFile::exists(pixPath))
{
showLocalPicture(pixPath, fileId);
}
else
{
QUrl url(pixPath);
if (url.isLocalFile())
{
pixPath = url.toLocalFile();
showLocalPicture(pixPath, fileId);
}
else
{
// http or empty
showRemotePicture(pixPath);
}
}
}
void ImageViewer::showLocalPicture(const QString& path, const QString& fileId)
{
currentFile = path;
currentFileId = fileId;
// loadAllCacheFile();
loadAllFile();
if (NULL!=mGifPlayer)
{
mGifPlayer->deleteLater();
}
mGifPlayer = new QMovie();
mGifPlayer->setFileName(currentFile);
int nCount = mGifPlayer->frameCount();
//由于有的图片有0帧,导致这个地方区分一下
connect(mGifPlayer,&QMovie::frameChanged,[this,nCount](int frameNumber){
QPixmap pixmap = mGifPlayer->currentPixmap();
rawPixmap = pixmap;
//QImage pixmapimage = mGifPlayer->currentImage();
//rawPixmap = pixmapimage;
_scaledSize();
});
mGifPlayer->start();
QPixmap pixmap;
if (nCount > 0)
{
pixmap = mGifPlayer->currentPixmap();
if (pixmap.isNull())
{
bool bret = pixmap.load(path);//QPixmap(":Images/Imageloadfail.png");
if (!bret)
{
pixmap = QPixmap(":Images/Imageloadfail.png");
Log::e(QString("load QPixmap is fail %1").arg(path));
}
rawPixmap = pixmap;
//rawPixmap = mGifPlayer->currentImage();
_scaledSize();
}
}
else
{
QString strfilePath = mGifPlayer->fileName();
pixmap =Biz::PortraitHelper::loadPixmap(strfilePath);
rawPixmap = pixmap;
//rawPixmap = mGifPlayer->currentImage();
}
int nwidth = pixmap.width();
int nheight = pixmap.height();
resizeImageFrame(QSize(pixmap.width(),pixmap.height()));
bScaleable = true;
ui.lbScledPixmap->setVisible(true);
ui.webRemoteUrl->setVisible(false);
ui.pre->setVisible(true);
ui.next->setVisible(true);
this->show();
ui.miniview->setVisible(false);
ui.ratetext->setVisible(false);
this->activateWindow();
this->setFocus();
bFirst = false;
}
void ImageViewer::showRemotePicture(const QString& path)
{
bScaleable = false;
ui.lbScledPixmap->setVisible(false);
ui.webRemoteUrl->setVisible(true);
ui.pre->setVisible(false);
ui.next->setVisible(false);
ui.boolbar->setVisible(false);
QString str = QString(
"<html><body><div style='height:100%; width:100%; display:table; text-align:center;'><span style='display:table-cell; vertical-align:middle;'><img src='%3' width='%1' height='%2'/><span></div></body></html>"
).arg(screenRect.width()/3/2).arg(screenRect.height()/3/2).arg(path);
ui.webRemoteUrl->setHtml(str);
resizeImageFrame(QSize(screenRect.width()/3,screenRect.height()/3));
this->show();
ui.miniview->setVisible(false);
ui.ratetext->setVisible(false);
this->activateWindow();
}
void ImageViewer::resizeImageFrame(const QSize& contentsize)
{
// 计算外框大小,不超过最大狂,不小于最小框,如果在适中范围内,匹配图的大小
QSize frameSize;
QSize size = contentsize;
if (this->isVisible())
{
frameSize = this->size();
}
else
{
frameSize = QSize(contentsize.width() + 20,contentsize.height() + 20);
if (frameSize.width()<minSize.width())
{
frameSize.setWidth(minSize.width());
}
if (frameSize.width()>maxSize.width())
{
frameSize.setWidth(maxSize.width());
}
if (frameSize.height()<minSize.height())
{
frameSize.setHeight(minSize.height());
}
if (frameSize.height()>maxSize.height())
{
frameSize.setHeight(maxSize.height());
}
}
// if (bFirst)
// {
// //frameSize = QSize(screenRect.width() , screenRect.height());
// }
// else
// {
// frameSize = QSize(this->width(), this->height());
// }
// if (bresize)
// {
// frameSize = QSize(this->width(), this->height());
// }
// 计算缩放比例,挑选宽高比例最严重的
float lastScaledRage = scaledRate;
scaledRate = 1.0;
QSize innerFrame = QSize(frameSize.width()-2,frameSize.height()-2);
if (size.width()>innerFrame.width())
{
scaledRate = innerFrame.width()*1.0/size.width();
}
if (size.height() > innerFrame.height())
{
float hr = innerFrame.height()*1.0/size.height();
if (hr < scaledRate)
{
scaledRate = hr;
}
}
size.setWidth((int)size.width()*scaledRate);
size.setHeight((int)size.height()*scaledRate);
// 按照比例将图进行缩放
scaledPixmap = rawPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
//scaledPixmap = QPixmap::fromImage(rawPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation));
// 设置各种框框尺寸和位置
// if ((frameSize.height()+30*2)<=maxSize.height())
// {
// if (!this->isVisible())
// frameSize.setHeight(frameSize.height()+30*2);
// }
QSize framebk(frameSize.width()-2,frameSize.height()-2); // 内接矩形
// this->setFixedSize(frameSize);
//move((screenRect.width() - this->width())/2 + rawpoint.x(), (screenRect.height() - this->height())/2 + rawpoint.y());
QDesktopWidget* desktopWidget = QApplication::desktop();
int screenIndex = desktopWidget->screenNumber(rawpoint);
QRect screenRecttmp = desktopWidget->screenGeometry(screenIndex);
this->setGeometry((screenRecttmp.width() - frameSize.width())/2 + rawpoint.x() , (screenRecttmp.height() - frameSize.height())/2 + rawpoint.y(), frameSize.width(), frameSize.height());
resizeImageWidget(size);
this->activateWindow();
this->setFocus();
}
void ImageViewer::onClose(bool b)
{
mGifPlayer->stop();
ui.lbScledPixmap->setPixmap(QPixmap(""));
close();
}
void ImageViewer::mousePressEvent(QMouseEvent *e)
{
if (bScaleable)
{
QPoint pos = e->pos();
QRect rect = ui.lbScledPixmap->rect();
rect.moveTo(ui.lbScledPixmap->pos());
if (rect.contains(pos))
{
imagePressed = true;
pressedPos = e->pos();
pressedImagePos = ui.lbScledPixmap->pos();
setCursor(Qt::OpenHandCursor);
//return;
}
else
{
imagePressed = false;
}
}
return LocalManWidget::mousePressEvent(e);
}
void ImageViewer::mouseReleaseEvent(QMouseEvent *e)
{
if (bScaleable)
{
if (imagePressed)
{
imagePressed = false;
setCursor(Qt::ArrowCursor);
//return;
}
}
return LocalManWidget::mouseReleaseEvent(e);
}
void ImageViewer::mouseDoubleClickEvent(QMouseEvent *e)
{
return LocalManWidget::mouseDoubleClickEvent(e);
}
void ImageViewer::mouseMoveEvent(QMouseEvent *e)
{
if (bScaleable)
{
// 判断是否该移动:图片(label)小于等于大框(this)
if (ui.lbScledPixmap->width() > this->width() || ui.lbScledPixmap->height() > this->height())
{
if (imagePressed)
{
QPoint pos = e->pos();
moveImageWidget(pos.x()-pressedPos.x(),pos.y()-pressedPos.y());
if (ui.miniview->isVisible())
{
moveImageMiniRect();
}
return;
}
}
}
return LocalManWidget::mouseMoveEvent(e);
}
void ImageViewer::onScrollSize(int distence)
{
if (distence>0)
{
scaledRate = scaledRate*scaleTick;
if (scaledRate > maxRate)
{
scaledRate = maxRate;
}
}
else
{
scaledRate = scaledRate/scaleTick;
if (scaledRate < minRate)
{
scaledRate = minRate;
}
}
ui.ratetext->setText(QString("%1%").arg((int)(scaledRate*100)));
ui.ratetext->setVisible(true);
picIndexTimeLine->setCurrentTime(0);
picIndexTimeLine->start();
_scaledSize();
}
void ImageViewer::_scaledSize(){
QSize size = rawPixmap.size();
size.setWidth((int)size.width()*scaledRate);
size.setHeight((int)size.height()*scaledRate);
// 按照比例将图进行缩放
resizeImageWidget(size);
if (size.width()>this->width() || size.height()>this->height())
{
showMiniView();
}
else
{
ui.miniview->setVisible(false);
}
}
void ImageViewer::wheelEvent(QWheelEvent *event)
{
if (!bScaleable)
{
event->ignore();
return;
}
QPoint numDegrees = event->angleDelta();
onScrollSize(numDegrees.y());
event->accept();
}
void ImageViewer::resizeImageWidget(const QSize& size)
{
scaledPixmap = rawPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
//QImage image = rawPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QSize currentSize = ui.lbScledPixmap->size();
ui.lbScledPixmap->setFixedSize(size);
QPoint pt((width() - ui.lbScledPixmap->width()) / 2, (height() - ui.lbScledPixmap->height()) / 2);
//if (currentSize!=size)
ui.lbScledPixmap->move((width()-ui.lbScledPixmap->width())/2,(height()-ui.lbScledPixmap->height())/2);
ui.lbScledPixmap->setPixmap(/*QPixmap::fromImage(image)*/scaledPixmap);
}
void ImageViewer::moveMiniImageWidget(int disX,int disY)
{
QPoint currentPos = ui.rectBorder->pos();
QPoint miniRectPos(miniPressedImagePos.x()+disX,miniPressedImagePos.y()+disY);
if (miniRectPos.x()<ui.miniimg->pos().x())
{
miniRectPos.setX(ui.miniimg->pos().x());
}
if (miniRectPos.y()<ui.miniimg->pos().y())
{
miniRectPos.setY(ui.miniimg->pos().y());
}
if (miniRectPos.x()+ui.rectBorder->width() > ui.miniimg->pos().x()+ui.miniimg->width())
{
miniRectPos.setX(ui.miniimg->pos().x()+ui.miniimg->width()-ui.rectBorder->width());
}
if (miniRectPos.y()+ui.rectBorder->height() > ui.miniimg->pos().y()+ui.miniimg->height())
{
miniRectPos.setY(ui.miniimg->pos().y()+ui.miniimg->height()-ui.rectBorder->height());
}
ui.rectBorder->move(miniRectPos);
int dx = scaledPixmap.width()*disX/ui.miniimg->width();
int dy = scaledPixmap.height()*disY/ui.miniimg->height();
moveImageWidget(-dx,-dy);
}
void ImageViewer::moveImageWidget(int disX,int disY)
{
// disX = disX * scaledRate;
// disY = disY * scaledRate;
QPoint currentPos = pressedImagePos;
QPoint fixPos = currentPos;
// 边界检查
if (disX>0)
{
// 左边,在框之内的,左右不动,在框外的,移动disX位置后不能右过左边界
if (this->rect().left() > currentPos.x())
{
int uidist_l = this->rect().left() - currentPos.x();
int x = currentPos.x();
fixPos.setX(currentPos.x() + (uidist_l>disX?disX:uidist_l));
}
}
else
{
// 右边界,向左移动的时候,不能左过右边界
if (this->rect().right() < currentPos.x()+ui.lbScledPixmap->width())
{
int uidist_r = this->rect().width() - (currentPos.x()+ui.lbScledPixmap->width()) ;
fixPos.setX(currentPos.x() + (uidist_r>disX?uidist_r:disX));
}
}
if (disY>0)
{
// 左边,在框之内的,左右不动,在框外的,移动disX位置后不能右过左边界
if (this->rect().top() > currentPos.y())
{
int uidist_t = this->rect().top() - currentPos.y();
fixPos.setY(currentPos.y() + (uidist_t>disY?disY:uidist_t));
}
}
else
{
// 右边界,向左移动的时候,不能左过右边界^
if (this->rect().height() < currentPos.y()+ui.lbScledPixmap->height())
{
int uidist_b = this->rect().height() - (currentPos.y()+ui.lbScledPixmap->height()) ;
fixPos.setY(currentPos.y() + (uidist_b>disY?uidist_b:disY));
}
}
ui.lbScledPixmap->move(fixPos);
}
void ImageViewer::showMiniView()
{
QPoint parentBR = rect().bottomRight();
// 根据原始图片的最大边算缩略度
float scale = 1.0;
int maxL = rawPixmap.width()>rawPixmap.height()?rawPixmap.width():rawPixmap.height();
int miniL = ui.miniview->width();
scale = miniL*1.0/maxL;
QSize scSize = QSize(rawPixmap.width()*scale,rawPixmap.height()*scale);
QPixmap pixmap = rawPixmap.scaled(scSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
// QPixmap pixmap = QPixmap::fromImage(rawPixmap.scaled(scSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
ui.miniimg->setFixedSize(scSize);
ui.miniimg->move( (ui.miniview->width()-ui.miniimg->width())/2,(ui.miniview->height()-ui.miniimg->height())/2);
ui.miniimg->setPixmap(pixmap);
ui.miniview->setVisible(true);
moveImageMiniRect();
}
void ImageViewer::moveImageMiniRect()
{
// 设置小框 ,大图的pos.x : 大图的宽 = 小图的pos.x : 小图的宽 、/ 高等同
int miniPosX = 0;
int miniPosY = 0;
int noticyW = ui.miniimg->width();
int noticyH = ui.miniimg->height();
if (ui.lbScledPixmap->pos().x()<=0)
{
int sPosX = qAbs(ui.lbScledPixmap->pos().x());
int minimgw = ui.miniimg->width();
int pw = ui.lbScledPixmap->width();
miniPosX = sPosX*ui.miniimg->width()/ui.lbScledPixmap->width();
noticyW = this->width()*ui.miniimg->width()/ui.lbScledPixmap->width();
}
if (ui.lbScledPixmap->pos().y()<=0)
{
int sPosY = qAbs(ui.lbScledPixmap->pos().y());
miniPosY = sPosY*ui.miniimg->height()/ui.lbScledPixmap->height();
noticyH = this->height()*ui.miniimg->height()/ui.lbScledPixmap->height();
}
ui.rectBorder->setFixedSize(QSize(noticyW,noticyH));
QPoint pt = ui.miniimg->pos();
ui.rectBorder->move(miniPosX+pt.x(),miniPosY+pt.y());
}
bool ImageViewer::eventFilter(QObject *obj, QEvent *event)
{
if (obj == ui.miniview)
{
if (event->type() == QEvent::Type::MouseButtonPress)
{
QMouseEvent* e = (QMouseEvent*)event;
if (bScaleable)
{
QPoint pos = e->pos();
QRect rect = ui.lbScledPixmap->rect();
rect.moveTo(ui.lbScledPixmap->pos());
if (rect.contains(pos))
{
miniImagePressed = true;
miniPressedPos = e->pos();
miniPressedImagePos = ui.rectBorder->pos();
pressedImagePos = ui.lbScledPixmap->pos();
setCursor(Qt::ClosedHandCursor);
return true;
}
else
{
imagePressed = false;
}
}
}
if (event->type() == QEvent::Type::MouseMove)
{
QMouseEvent* e = (QMouseEvent*)event;
if (bScaleable)
{
if (miniImagePressed)
{
QPoint pos = e->pos();
moveMiniImageWidget(pos.x()-miniPressedPos.x(),pos.y()-miniPressedPos.y());
return true;
}
}
}
if (event->type() == QEvent::Type::MouseButtonRelease)
{
QMouseEvent* e = (QMouseEvent*)event;
if (bScaleable)
{
if (miniImagePressed)
{
miniImagePressed = false;
setCursor(Qt::ArrowCursor);
return true;
}
}
}
}
return LocalManWidget::eventFilter(obj,event);
}
void ImageViewer::loadAllCacheFile()
{
/*int leftpos = currentFile.lastIndexOf("\\");
if (leftpos<0 || leftpos>currentFile.length())
{
leftpos = currentFile.lastIndexOf("/");
}
QString path = currentFile.left(leftpos);
QDir dir(path);
if (!dir.exists())
return;
dir.setFilter(QDir::Files);
dir.setSorting(QDir::Time);
QFileInfoList list = dir.entryInfoList();
int i = 0;
bool bIsDir;
files.clear();
while(i<list.size()){
QFileInfo fileInfo = list.at(i);
if(fileInfo.fileName()=="."|fileInfo.fileName()=="..")
{
i++;
continue;
}
bIsDir = fileInfo.isDir();
if (bIsDir)
{
continue;
}
else
{
if (!fileInfo.fileName().endsWith(".tmp"))
{
files.append(fileInfo.filePath());
}
}
i++;
}
*/
}
void ImageViewer::enterEvent(QEvent *)
{
if (bScaleable)
{
ui.boolbar->setVisible(true);
QSize size = scaledPixmap.size();
if (size.width()>this->width() || size.height()>this->height())
{
ui.miniview->setVisible(true);
}
}
}
void ImageViewer::leaveEvent(QEvent *)
{
if (bScaleable)
{
ui.boolbar->setVisible(false);
ui.miniview->setVisible(false);
}
}
void ImageViewer::resetSizeLimited()
{
rawpoint = QCursor::pos();
QDesktopWidget* desktopWidget = QApplication::desktop();
int screenIndex = desktopWidget->screenNumber(rawpoint);
screenRect = desktopWidget->screenGeometry(screenIndex);
minSize = QSize(screenRect.width()/3,screenRect.height()/3);
maxSize = QSize(screenRect.width()-100,screenRect.height()-100);
QWidget* widget = desktopWidget->screen(screenIndex);
rawpoint = desktopWidget->screenGeometry(screenIndex).topLeft();
}
void ImageViewer::keyPressEvent(QKeyEvent *event)
{
if (Qt::NoModifier == event->modifiers())
{
if (Qt::Key_Up == event->key() || Qt::Key_Left == event->key())
{
showPrePicture();
}
if (Qt::Key_Down == event->key() || Qt::Key_Right == event->key())
{
showNextPicture();
}
}
if (event->key() == Qt::Key_Escape)
{
this->close();
}
return LocalManWidget::keyPressEvent(event);
}
void ImageViewer::showNextPicture()
{
mGifPlayer->stop();
// files的是按照时间倒序排列,下一张照片,应该时间增加,故游标减小
if (mImagefiles.size() != 0)
{
int i =( getImageOrderbyCurrent()+1 + mImagefiles.size() )%mImagefiles.size();
showLocalPicture(getImageLocalPath(i), getImageFileId(i)/*mImagefiles.at(i).fileLocalPath, mImagefiles.at(i).fileId*/);
// index 由0base转化为1base
// index 按照时间倒叙一下
QString info = QString("%1/%2").arg(mImagefiles.size()-i).arg(mImagefiles.size());
QFontMetrics elidfont( ui.ratetext-> font());
int nNeedWidth = elidfont.width(info);
ui.ratetext->setText(info);
ui.ratetext->setFixedWidth(qMax(nNeedWidth,ui.ratetext->width()));
ui.ratetext->move((width()-ui.ratetext->width())/2,(height()-ui.ratetext->height())/2);
ui.ratetext->setVisible(true);
picIndexTimeLine->setCurrentTime(0);
picIndexTimeLine->start();
}
}
void ImageViewer::showPrePicture()
{
mGifPlayer->stop();
// files的是按照时间倒序排列,上一张照片,应该时间减小,故游标增加
if (mImagefiles.size() != 0)
{
int i =( getImageOrderbyCurrent() - 1 ) % mImagefiles.size();
// index 由0base转化为1base
// index 按照时间倒叙一下
showLocalPicture(getImageLocalPath(i), getImageFileId(i));
QString info = QString("%1/%2").arg(mImagefiles.size()-i).arg(mImagefiles.size());
QFontMetrics elidfont( ui.ratetext-> font());
int nNeedWidth = elidfont.width(info);
ui.ratetext->setText(info);
ui.ratetext->setFixedWidth(qMax(nNeedWidth,ui.ratetext->width()));
ui.ratetext->move((width()-ui.ratetext->width())/2,(height()-ui.ratetext->height())/2);
ui.ratetext->setVisible(true);
picIndexTimeLine->setCurrentTime(0);
picIndexTimeLine->start();
}
}
void ImageViewer::loadAllFile()
{
if(!QFile::exists(currentFile))
{
return;
}
QFileInfo fileinfo(currentFile);
QDir dir = fileinfo.absoluteDir();
QString jid = dir.dirName();
mImagefiles.clear();
QList <QSharedPointer <Biz::ImageAttachInfor>> listimage = Biz::Session::getAttachmentManager()->getImageAttachlist(jid);
for (QSharedPointer<Biz::ImageAttachInfor> oneattachImage: listimage)
{
QString strfileLocalPath = oneattachImage->LocalPath();
ImageOrder imageorder;
if (!strfileLocalPath.isEmpty() && QFile::exists(strfileLocalPath))
{
imageorder.orderId = mImagefiles.size() + 1;
imageorder.fileId = oneattachImage->ImageId();
imageorder.fileLocalPath = strfileLocalPath;
//files.append(strfileLocalPath);
//files.push_back(strfileLocalPath);
mImagefiles.push_back(imageorder);
}
}
int nsize = mImagefiles.size();
}
int ImageViewer::getImageOrderbyCurrent()
{
int norder = 0;
for (ImageOrder oneorder: mImagefiles)
{
++norder;
if (oneorder.fileId == currentFileId && currentFile == oneorder.fileLocalPath)
{
return oneorder.orderId - 1; //因为从1开始的,而数组应该从0开始
}
}
return mImagefiles.size() - 1;
}
QString ImageViewer::getImageLocalPath( int nIndex )
{
for (ImageOrder oneorder: mImagefiles)
{
if ((oneorder.orderId - 1) == nIndex)
{
return oneorder.fileLocalPath;
}
}
return QString::number(mImagefiles.size() - 1);
//return mImagefiles.at(i).fileLocalPath;
}
QString ImageViewer::getImageFileId(int nIndex)
{
for (ImageOrder oneorder: mImagefiles)
{
if ( (oneorder.orderId - 1) == nIndex)
{
return oneorder.fileId;
}
}
return QString::number(mImagefiles.size() - 1);
//return mImagefiles.at(i).fileId;
}
void ImageViewer::resizeEvent( QResizeEvent *event )
{
LocalManWidget::resizeEvent(event);
if(!bFirst)
{
QSize resizeframesize = QSize(this->width(), this->height());
screenRect.setWidth(resizeframesize.width());
screenRect.setHeight(resizeframesize.height());
//resizeImageFrame(framesize);
QSize frameSize = resizeframesize;
//获取图片的宽和高
if (NULL!=mGifPlayer)
{
mGifPlayer->deleteLater();
}
mGifPlayer = new QMovie();
mGifPlayer->setFileName(currentFile);
int nCount = mGifPlayer->frameCount();
connect(mGifPlayer,&QMovie::frameChanged,[this,nCount](int frameNumber){
QPixmap pixmap = mGifPlayer->currentPixmap();
rawPixmap = pixmap;
_scaledSize();
});
mGifPlayer->start();
QPixmap pixmap;
if (nCount > 0)
{
pixmap = mGifPlayer->currentPixmap();
if (pixmap.isNull())
{
bool bret = pixmap.load(currentFile);//QPixmap(":Images/Imageloadfail.png");
if (!bret)
{
pixmap = QPixmap(":Images/Imageloadfail.png");
Log::e(QString("load QPixmap is fail %1").arg(currentFile));
}
rawPixmap = pixmap;
//rawPixmap = mGifPlayer->currentImage();
_scaledSize();
}
}
else
{
QString strfilePath = mGifPlayer->fileName();
pixmap =Biz::PortraitHelper::loadPixmap(strfilePath);
rawPixmap = pixmap;
//rawPixmap = mGifPlayer->currentImage();
}
int nwidth = pixmap.width();
int nheight = pixmap.height();
QSize size = QSize(nwidth, nheight);
// 计算缩放比例,挑选宽高比例最严重的
float lastScaledRage = scaledRate;
scaledRate = 1.0;
QSize innerFrame = QSize(frameSize.width()-2,frameSize.height()-2);
if (size.width()>innerFrame.width())
{
scaledRate = innerFrame.width()*1.0/size.width();
}
if (size.height() > innerFrame.height())
{
float hr = innerFrame.height()*1.0/size.height();
if (hr < scaledRate)
{
scaledRate = hr;
}
}
size.setWidth((int)size.width()*scaledRate);
size.setHeight((int)size.height()*scaledRate);
// 按照比例将图进行缩放
scaledPixmap = rawPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
//scaledPixmap = QPixmap::fromImage(rawPixmap.scaled(size,Qt::KeepAspectRatio, Qt::SmoothTransformation));
// 设置各种框框尺寸和位置
// if ((frameSize.height()+30*2)<=maxSize.height())
// {
// if (!this->isVisible())
// frameSize.setHeight(frameSize.height()+30*2);
// }
QSize framebk(frameSize.width()-2,frameSize.height()-2); // 内接矩形
QDesktopWidget* desktopWidget = QApplication::desktop();
int screenIndex = desktopWidget->screenNumber(rawpoint);
QRect screenRecttmp = desktopWidget->screenGeometry(screenIndex);
this->setGeometry( rawpoint.x() + (screenRecttmp.width() - frameSize.width())/2 , rawpoint.y() + (screenRecttmp.height() - frameSize.height())/2, frameSize.width(), frameSize.height());
//resizeImageWidget(size);
_scaledSize();
bresize = true;
}
this->setSizeGripEnabled(true);
}
| [
"20832776@qunar.com"
] | 20832776@qunar.com |
7d05a880a94a338d04a70da805bc4051e52c2071 | afcc2955f3607e47daa71b1d9f6b1de124cd570c | /andEnginePhysicsBox2DExtension/src/main/jni/Box2D/Common/b2StackAllocator.h | b0d128c9f873b53388fc7cd07836f6d051b50f62 | [] | no_license | ESal0/AndroidGame | a72d9035c918d0088a493a48bf558a52edd2541f | ef4dba0b5ed433a3c4b7f2bbf0637e095f5b9c55 | refs/heads/master | 2016-09-05T11:48:51.114690 | 2015-08-27T07:08:10 | 2015-08-27T07:08:10 | 40,919,772 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,722 | h | /*
* Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef B2_STACK_ALLOCATOR_H
#define B2_STACK_ALLOCATOR_H
#include "Box2D/Common/b2Settings.h"
const int32 b2_stackSize = 100 * 1024; // 100k
const int32 b2_maxStackEntries = 32;
struct b2StackEntry {
char *data;
int32 size;
bool usedMalloc;
};
// This is a stack allocator used for fast per step allocations.
// You must nest allocate/free pairs. The code will assert
// if you try to interleave multiple allocate/free pairs.
class b2StackAllocator {
public:
b2StackAllocator();
~b2StackAllocator();
void *Allocate(int32 size);
void Free(void *p);
int32 GetMaxAllocation() const;
private:
char m_data[b2_stackSize];
int32 m_index;
int32 m_allocation;
int32 m_maxAllocation;
b2StackEntry m_entries[b2_maxStackEntries];
int32 m_entryCount;
};
#endif
| [
"eric.salomon@haw-hamburg.de"
] | eric.salomon@haw-hamburg.de |
14a81cbd74509a205e41ba810cd7109ab1875f26 | 9f4744315fa963bdc715e4e33813ae7851173744 | /Code Framework/Components/NOR2.cpp | 40bceceba0ebf9896591e9212bbad24e2e756d0c | [] | no_license | MohammedEl-sayedAhmed/Circuit_Logic_Simulator_UsingCPP | 20a1d0e222e5e7576d1ff5740e1f09a8267efe2a | 935ea3dc25c3c17b3c27fb8ebd04392ea643d458 | refs/heads/master | 2020-12-14T04:48:01.458227 | 2020-09-03T01:47:38 | 2020-09-03T01:47:38 | 234,644,691 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,443 | cpp | #include "NOR2.h"
#include <iostream>
using namespace std;
NOR2::NOR2(GraphicsInfo *r_pGfxInfo, int r_FanOut):Gate(r_pGfxInfo,2, r_FanOut)
{
}
void NOR2::Operate()
{
//caclulate the output status as the NORing of the two input pins
if (m_InputPins[0].getStatus() == HIGH || m_InputPins[1].getStatus() == HIGH) {
m_OutputPin.setStatus(LOW);
}
else if (m_InputPins[0].getStatus() == LOW && m_InputPins[1].getStatus() == LOW) {
m_OutputPin.setStatus(HIGH);
}
}
// Function Draw
// Draws 2-input NOR gate
void NOR2::Draw(UI* pUI)
{
//Call output class and pass gate drawing info to it.
pUI->DrawNOR2(*m_pGfxInfo, Selected);
}
//returns status of outputpin
int NOR2::GetOutPinStatus()
{
return m_OutputPin.getStatus();
}
//returns status of Inputpin #n
int NOR2::GetInputPinStatus(int n)
{
return m_InputPins[n-1].getStatus(); //n starts from 1 but array index starts from 0.
}
//Set status of an input pin ot HIGH or LOW
void NOR2::setInputPinStatus(int n, STATUS s)
{
m_InputPins[n-1].setStatus(s);
}
//virtual type getter function
string NOR2::GetComponentType()
{
return "NOR2";
}
//Checks whether the clicked point is in the region of the NOR gate or not
bool NOR2::IsInRegion(int x, int y)
{
if (x >= GetCornerDoX() && x <= (GetCornerDoX() + GetGateWidth()))
{
if (y >= GetCornerDoY() && y <= (GetCornerDoY() + GetGatHeight()))
{
cout << "NOR2 is in region\n";
return true;
}
}
return false;
}
| [
"mohammedelsayed4648@gmail.com"
] | mohammedelsayed4648@gmail.com |
18d33ae1c9ff4db3a726439393579f36f4aaf82d | 427419228ca489739e16c380d7bc68a6ef509e5a | /A_Cut_Ribbon.cpp | 6c145e43cf704fcbffa22c309d734d7791d9964c | [] | no_license | wolverinezgit/cpsolutions | d5dca485190a27f4d27e9610cd6ea02d98a50072 | e0e695036cbd4c51ec9bf57d585b40204c8566a1 | refs/heads/main | 2023-03-10T12:31:27.848231 | 2021-02-18T13:04:00 | 2021-02-18T13:04:00 | 332,387,127 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 596 | cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
int main()
{
ll t,i,n,j,flag=0,mx=0,mn=1e9+7,k;
ll a,b,c;
cin >> n;
cin >> a >> b >> c;
for (i = 0; i*a <= n;i++)
{
for (j = 0; (i*a+j*b)<= n;j++)
{
if ((n - (i * a) - (j * b)) % c == 0)
{
k = (n - (i * a) - (j * b)) / c;
mx = max(mx, i + j + k);
}
}
}
cout << mx << endl;
return 0;
} | [
"iamharsh05@gmail.com"
] | iamharsh05@gmail.com |
95239b2fd1a76dcbe226d0b3123950e3f8fb0ca8 | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/inetsrv/iis/iisrearc/ul/win9x/src/test/ulvxdobj/ulapi.cpp | e1dc4f00c608a8a9433255e2345c070591975825 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,552 | cpp | // ULApi.cpp : Implementation of CULApi
#include "stdafx.h"
#include "Ulvxdobj.h"
#include "ULApi.h"
#include "Ulvxdobj.h"
#include "win32handle.h"
#include "ulapi9x.h"
#include <wchar.h>
/*
#include <stdio.h>
#include <stdlib.h>
#include <ioctl.h>
#include <errors.h>
#include <structs.h>
*/
//#include <structs.h>
/////////////////////////////////////////////////////////////////////////////
// CULApi
#define CLEAR_ERROR() { m_dwLastError = 0; }
STDMETHODIMP CULApi::LoadVXD()
{
// TODO: Add your implementation code here
//DebugBreak();
m_dwLastError = UlInitialize(0);
return S_OK;
}
STDMETHODIMP CULApi::RegisterUri(
BSTR szUri,
IWin32Handle * pParentUri,
DWORD ulFlags,
IWin32Handle **ppRetVal)
{
// TODO: Add your implementation code here
BOOL bOK = FALSE;
CWin32Handle * pWin32Handle = NULL;
HRESULT Result;
LPWSTR pUri = NULL;
DWORD hParentUri = -1, hUriHandle = -1;
//USES_CONVERSION;
//pParentUri->get_UriHandle(&hParentUri);
hParentUri = NULL; // pParentUri->URIHandle();
CLEAR_ERROR()
m_dwLastError = UlRegisterUri(
&hUriHandle,
hParentUri,
(PWSTR)szUri,
ulFlags);
if ( m_dwLastError == ERROR_SUCCESS )
{
pWin32Handle = new CComObject<CWin32Handle>;
if( pWin32Handle == NULL )
return E_OUTOFMEMORY;
Result = pWin32Handle->_InternalQueryInterface(
IID_IWin32Handle,
(PVOID*)ppRetVal);
if (FAILED(Result))
return E_FAIL;
pWin32Handle->put_URIHandle(hUriHandle);
}
return S_OK;
}
STDMETHODIMP CULApi::get_LastError(DWORD *pVal)
{
// TODO: Add your implementation code here
*pVal = m_dwLastError;
return S_OK;
}
STDMETHODIMP CULApi::put_LastError(DWORD newVal)
{
// TODO: Add your implementation code here
m_dwLastError = newVal;
return S_OK;
}
STDMETHODIMP CULApi::SendString(IWin32Handle *pUriHandle, IOverlapped * pOverlapped, BSTR szSourceSuffix, BSTR szTargetUri, BSTR szData)
{
// TODO: Add your implementation code here
ULONG ulTargetUriLength;
ULONG dwBytesSent = 0;
BYTE * pData = NULL;
BOOL bOK = FALSE;
OVERLAPPED Overlapped, * lpOverlappedStruct = NULL;
DWORD hUriHandle = -1;
DWORD ulBytesToSend = 0;
CLEAR_ERROR();
ulTargetUriLength = ( szTargetUri == NULL ) ? 0 : wcslen( szTargetUri );
pUriHandle->get_URIHandle(&hUriHandle);
ulBytesToSend = (wcslen(szData) + 1)*sizeof(WCHAR); // for UNICODE
#define MALLOC_DATA_TO_SEND
#ifndef MALLOC_DATA_TO_SEND
pData = (unsigned char *)szData;
#else
pData = new BYTE[ulBytesToSend];
memcpy((void *)pData, (void *)szData, ulBytesToSend);
#endif
if(pOverlapped != NULL ) {
pOverlapped->ResetEvent();
//
// Read in values from the overlapped object
// into our overlapped structure
//
pOverlapped->get_Offset(&Overlapped.Offset);
pOverlapped->get_OffsetHigh(&Overlapped.OffsetHigh);
pOverlapped->get_Internal(&Overlapped.Internal);
pOverlapped->get_InternalHigh(&Overlapped.InternalHigh);
pOverlapped->get_Handle((LPDWORD)&Overlapped.hEvent);
lpOverlappedStruct = &Overlapped;
} else {
lpOverlappedStruct = NULL;
}
USES_CONVERSION;
WCHAR szOutput[1024];
WCHAR * szPtr = NULL;
int strlen = wcslen(szData);
szPtr = szData;
if( strlen > 1020 ) {
szPtr = L"<trunc>";
}
swprintf(szOutput,L"%.8x (%s) length = %d\n" , szData, szPtr, strlen );
OutputDebugString("Sending data ...\n");
OutputDebugString(OLE2T(szOutput));
//DebugBreak();
m_dwLastError =
UlSendMessage(
hUriHandle, // IN URIHANDLE hUriHandle,
(PWSTR) szSourceSuffix, //IN PWSTR pSourceSuffix OPTIONAL,
szTargetUri, // IN PWSTR pTargetUri,
pData, // IN PVOID pData,
ulBytesToSend, // IN ULONG ulBytesToSend,
&dwBytesSent, // OUT PULONG pBytesSent OPTIONAL,
lpOverlappedStruct //IN OVERLAPPED *pOverlapped OPTIONAL
);
//
// Update values from our overlapped structure
// into the IOverlapped interface
//
pOverlapped->put_Offset(Overlapped.Offset);
pOverlapped->put_OffsetHigh(Overlapped.OffsetHigh);
pOverlapped->put_Internal(Overlapped.Internal);
pOverlapped->put_InternalHigh(Overlapped.InternalHigh);
pOverlapped->put_Handle((DWORD)Overlapped.hEvent);
return S_OK; // HRESULT_FROM_WIN32(m_dwLastError);
}
STDMETHODIMP CULApi::new_Overlapped(DWORD dwOffset, DWORD dwOffsetHigh)
{
// TODO: Add your implementation code here
m_Overlapped.Offset = dwOffset;
m_Overlapped.OffsetHigh = dwOffsetHigh;
m_Overlapped.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
return S_OK;
}
STDMETHODIMP CULApi::WaitForSendCompletion(DWORD dwTimeout)
{
// TODO: Add your implementation code here
HRESULT hResult = S_OK;
CLEAR_ERROR();
DWORD dwResult =
WaitForSingleObject( m_Overlapped.hEvent, dwTimeout);
switch(dwResult) {
case WAIT_OBJECT_0:
m_dwLastError = ERROR_SUCCESS;
hResult = S_OK;
break;
case WAIT_TIMEOUT:
m_dwLastError = ERROR_TIMEOUT;
//hResult = HRESULT_FROM_WIN32(m_dwLastError);
break;
case WAIT_FAILED:
m_dwLastError = GetLastError();
//hResult = HRESULT_FROM_WIN32(m_dwLastError);
break;
default:
hResult = E_FAIL;
break;
}
return hResult;
}
STDMETHODIMP CULApi::Test(BYTE *pArray, DWORD dwBufferSize, DWORD * dwBytesRead)
{
// TODO: Add your implementation code here
int i = 0;
CHAR szString[256];
//+DebugBreak();
DWORD dwSize = (dwBufferSize > 10 ) ? (dwBufferSize - 5 ) : dwBufferSize;
for( i = 0; i < (int) dwSize; i++ ) {
pArray[i] = 'a';
}
*dwBytesRead = dwSize;
sprintf( szString, "dwBufferSize = %d, dwBytesRead = %d\n", dwBufferSize, *dwBytesRead );
OutputDebugString(szString);
return S_OK;
}
STDMETHODIMP CULApi::ReceiveString(IWin32Handle *pUriHandle, IOverlapped * pOverlapped)
{
// TODO: Add your implementation code here
DWORD hUriHandle = -1;
DWORD ulBufferSize = 16;
//SAFEARRAY * m_pSafeArray;
BYTE * pData = NULL;
BOOL bOK = FALSE;
HRESULT hr;
int i;
CHAR * szTemp = NULL;
CHAR szDbg[1024];
WCHAR szOutput[1024];
USES_CONVERSION;
CLEAR_ERROR();
pUriHandle->get_URIHandle(&hUriHandle);
OVERLAPPED Overlapped, *pOverlappedStruct = NULL;
#ifdef _SAFEARRAY_USE
//
// get the pointer to the internal buffer
// the SafeArray is holding
//
hr = SafeArrayAccessData(
m_pSafeArray,
(VOID HUGEP **) &pData );
memset( (void *) pData, 0, m_dwReadBufferSize );
if(FAILED(hr)) {
return hr;
}
#else
pData = (BYTE *) m_wchar_buffer;
memset( (void *) pData, 0, m_dwReadBufferSize*sizeof(WCHAR) );
#endif
if(pOverlapped != NULL ) {
pOverlappedStruct = &Overlapped;
pOverlapped->ResetEvent();
//
// Read in values from the overlapped object
// into our overlapped structure
//
pOverlapped->get_Offset(&Overlapped.Offset);
pOverlapped->get_OffsetHigh(&Overlapped.OffsetHigh);
pOverlapped->get_Internal(&Overlapped.Internal);
pOverlapped->get_InternalHigh(&Overlapped.InternalHigh);
pOverlapped->get_Handle((LPDWORD)&Overlapped.hEvent);
} else {
pOverlappedStruct = NULL;
}
m_dwLastError = UlReceiveMessage(
hUriHandle,
pData,
m_dwReadBufferSize,
&m_dwBytesReceived,
&m_dwBytesRemaining,
pOverlappedStruct);
//
// Update values from our overlapped structure
// into the IOverlapped interface
//
if((pOverlapped!=NULL) && (pOverlappedStruct != NULL)) {
pOverlapped->put_Offset(Overlapped.Offset);
pOverlapped->put_OffsetHigh(Overlapped.OffsetHigh);
pOverlapped->put_Internal(Overlapped.Internal);
pOverlapped->put_InternalHigh(Overlapped.InternalHigh);
pOverlapped->put_Handle((DWORD)Overlapped.hEvent);
}
if ( m_dwLastError != ERROR_SUCCESS )
{
goto done;
}
szTemp = szDbg;
for(i = 0; i < (int)m_dwBytesReceived; i++ ) {
szTemp += sprintf( szTemp, "%.2X ", pData[i] );
}
OutputDebugString("***(");
OutputDebugString(szDbg);
OutputDebugString(")***\n");
#ifdef _SAFEARRAY_USE
if( m_szData != NULL ) {
SysFreeString(m_szData);
}
/*
hr = BstrFromVector(
m_pSafeArray,
&m_szData);
*/
m_szData = SysAllocStringByteLen(
(LPCSTR) pData,
m_dwBytesReceived);
//if( FAILED(hr)) {
if( m_szData == NULL) {
m_dwLastError = GetLastError();
} else
m_dwLastError = ERROR_SUCCESS;
OutputDebugString("Received data ... ");
swprintf(szOutput,
L"%.8x (%s) length = %d\n" ,
m_szData,
m_szData,
wcslen(m_szData));
OutputDebugString(OLE2T(szOutput));
#else
OutputDebugString("Received data ... ");
swprintf(szOutput,
L"%.8x (%s) length = %d\n" ,
m_wchar_buffer,
m_wchar_buffer,
wcslen(m_wchar_buffer));
OutputDebugString(OLE2T(szOutput));
#endif
done:
//if(FAILED(SafeArrayUnaccessData(m_pSafeArray))) {
// m_dwLastError = GetLastError();
//}
return S_OK;
}
STDMETHODIMP CULApi::get_BytesReceived(DWORD *pVal)
{
// TODO: Add your implementation code here
*pVal = m_dwBytesReceived;
return S_OK;
}
STDMETHODIMP CULApi::put_BytesReceived(DWORD newVal)
{
// TODO: Add your implementation code here
m_dwBytesReceived = newVal;
return S_OK;
}
STDMETHODIMP CULApi::get_BytesRemaining(DWORD *pVal)
{
// TODO: Add your implementation code here
*pVal = m_dwBytesRemaining;
return S_OK;
}
STDMETHODIMP CULApi::put_BytesRemaining(DWORD newVal)
{
// TODO: Add your implementation code here
m_dwBytesRemaining = newVal;
return S_OK;
}
STDMETHODIMP CULApi::get_Data(BSTR *pVal)
{
// TODO: Add your implementation code here
WCHAR szDebug[1024];
USES_CONVERSION;
#ifdef _SAFEARRAY_USE
*pVal = m_szData;
#else
*pVal = ::SysAllocString(m_wchar_buffer);
swprintf( szDebug, L"get_data(): %s (%d)\n",
m_wchar_buffer, wcslen(m_wchar_buffer));
#endif
OutputDebugString(OLE2T(szDebug));
return S_OK;
}
STDMETHODIMP CULApi::put_Data(BSTR newVal)
{
// TODO: Add your implementation code here
m_szData = newVal;
return S_OK;
}
STDMETHODIMP CULApi::new_ReceiveOverlapped(DWORD dwOffset, DWORD dwOffsetHigh)
{
// TODO: Add your implementation code here
m_ReceiveOverlapped.Offset = dwOffset;
m_ReceiveOverlapped.OffsetHigh = dwOffsetHigh;
m_ReceiveOverlapped.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
return S_OK;
}
STDMETHODIMP CULApi::WaitForReceiveCompletion(DWORD dwTimeout)
{
// TODO: Add your implementation code here
HRESULT hResult = E_FAIL;
USES_CONVERSION;
CLEAR_ERROR();
DWORD dwResult =
WaitForSingleObject( m_ReceiveOverlapped.hEvent, dwTimeout);
OutputDebugString("WaitForReceiveCompletion\n");
WCHAR szOutput[1024];
//DebugBreak();
switch(dwResult) {
case WAIT_OBJECT_0:
m_dwLastError = ERROR_SUCCESS;
hResult = BstrFromVector(
m_pSafeArray,
&m_szData);
if( FAILED(hResult)) {
m_dwLastError = GetLastError();
break;
} else
m_dwLastError = ERROR_SUCCESS;
OutputDebugString("Received data ... ");
swprintf(szOutput,L"%.8x (%s) length = %d\n" , m_szData, m_szData,
wcslen(m_szData) );
OutputDebugString(OLE2T(szOutput));
//DebugBreak();
hResult = S_OK;
break;
case WAIT_TIMEOUT:
m_dwLastError = ERROR_TIMEOUT;
hResult = S_OK; // HRESULT_FROM_WIN32(m_dwLastError);
break;
case WAIT_FAILED:
m_dwLastError = GetLastError();
hResult = S_OK; // HRESULT_FROM_WIN32(m_dwLastError);
break;
default:
hResult = E_FAIL;
break;
}
return hResult;
}
STDMETHODIMP CULApi::unloadVXD()
{
// TODO: Add your implementation code here
OutputDebugString("+ unloadVXD\n");
CLEAR_ERROR();
UlTerminate();
OutputDebugString("- unloadVXD\n");
return S_OK;
}
STDMETHODIMP CULApi::UnregisterUri(IWin32Handle *pUriHandle)
{
// TODO: Add your implementation code here
CLEAR_ERROR();
DWORD hUriHandle = -1;
pUriHandle->get_URIHandle(&hUriHandle);
m_dwLastError = UlUnregisterUri(hUriHandle);
return S_OK;
}
STDMETHODIMP CULApi::get_ReadBufferSize(DWORD *pVal)
{
// TODO: Add your implementation code here
*pVal = m_dwReadBufferSize;
return S_OK;
}
STDMETHODIMP CULApi::put_ReadBufferSize(DWORD newVal)
{
// TODO: Add your implementation code here
#ifdef _SAFEARRAY_USE
m_dwReadBufferSize = newVal;
if( m_pSafeArray != NULL ) {
HRESULT hr = SafeArrayDestroy(m_pSafeArray);
m_pSafeArray = NULL;
}
m_pSafeArray = SafeArrayCreateVector(
VT_UI1,
0,
m_dwReadBufferSize);
#else
m_dwReadBufferSize = newVal;
if( m_wchar_buffer != NULL ) {
delete m_wchar_buffer;
m_wchar_buffer = NULL;
}
m_wchar_buffer = new WCHAR[m_dwReadBufferSize];
#endif
return S_OK;
}
STDMETHODIMP CULApi::DebugPrint(BSTR szString)
{
// TODO: Add your implementation code here
WCHAR szOutput[1024];
USES_CONVERSION;
DWORD dwProcessId = GetCurrentProcessId();
HANDLE hProcess = GetCurrentProcess();
swprintf(szOutput, L"** [%.8x] ** : %s\n", dwProcessId, szString );
OutputDebugString(OLE2T(szOutput));
return S_OK;
}
STDMETHODIMP CULApi::WaitForCompletion(IOverlapped *pOverlapped, DWORD dwTimeout)
{
// TODO: Add your implementation code here
HRESULT hResult = E_FAIL;
USES_CONVERSION;
CLEAR_ERROR();
HANDLE hEvent = NULL;
pOverlapped->get_Handle((LPDWORD)&hEvent);
DWORD dwResult =
WaitForSingleObject( hEvent, dwTimeout);
OutputDebugString("WaitForCompletion\n");
WCHAR szOutput[1024];
BOOL fIsReceive = FALSE;
pOverlapped->get_IsReceive(&fIsReceive);
//DebugBreak();
switch(dwResult) {
case WAIT_OBJECT_0:
m_dwLastError = ERROR_SUCCESS;
if( fIsReceive ) {
#ifdef _SAFEARRAY_USE
hResult = BstrFromVector(
m_pSafeArray,
&m_szData);
if( FAILED(hResult)) {
m_dwLastError = GetLastError();
break;
} else
m_dwLastError = ERROR_SUCCESS;
OutputDebugString("Received data ... ");
swprintf(szOutput,L"%.8x (%s) length = %d\n" , m_szData, m_szData,
wcslen(m_szData));
OutputDebugString(OLE2T(szOutput));
#else
OutputDebugString("Received data ... ");
swprintf(szOutput,L"%.8x (%s) length = %d\n" , m_wchar_buffer,
m_wchar_buffer, wcslen(m_wchar_buffer));
OutputDebugString(OLE2T(szOutput));
#endif
//DebugBreak();
}
hResult = S_OK;
break;
case WAIT_TIMEOUT:
m_dwLastError = ERROR_TIMEOUT;
hResult = S_OK; // HRESULT_FROM_WIN32(m_dwLastError);
break;
case WAIT_FAILED:
m_dwLastError = GetLastError();
hResult = S_OK; // HRESULT_FROM_WIN32(m_dwLastError);
break;
default:
hResult = E_FAIL;
break;
}
return hResult;
}
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
7774f1c109c55c426ba35a4f565ee7af95f839fe | 76957b84c5c97ac08dd2baea6cd3d5db96d26012 | /common_project/tool_kits/game/model/command_handler/heartbeat_helper.h | 6ebc3deb2dbf3c1a2c0e2fbbe1e6b96b3b0971bd | [] | no_license | luchengbiao/base | 4e14e71b9c17ff4d2f2c064ec4f5eb7e9ce09ac8 | f8af675e01b0fee31a2b648eb0b95d0c115d68ff | refs/heads/master | 2021-06-27T12:04:29.620264 | 2019-04-29T02:39:32 | 2019-04-29T02:39:32 | 136,405,188 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,421 | h | #ifndef __GAME_MODEL_COMMAND_HANDLER_HERATBEAT_HELPER_H__
#define __GAME_MODEL_COMMAND_HANDLER_HERATBEAT_HELPER_H__
#include <QObject>
#include "base/callback/callback.h" // for StdClosure
#include "common/weak_callback/weak_callback.h"
#include "game/model/command_handler/command_handler_fwd.h"
#include "protocol/command/base/command_fwd.h"
GAME_NAMESPACE_BEGIN
class HeartbeatHelper : public QObject, public wcb::SupportWeakCallback<HeartbeatHelper>
{
Q_OBJECT
typedef wcb::WeakCallbackFlagCancelable<HeartbeatHelper> MyWeakCallbackFlag;
friend class CommandHandler;
public:
static std::shared_ptr<HeartbeatHelper> Create(const CommandHandlerWeakPtr& command_handler);
/**
* true: all of the commands in group are Heartbeat
* false: at least one of the commands in group is not Heartbeat
*/
bool TryToHandleMasterHeartbeatCommands(const CommandGroupSharedPtr& cmd_group, bool sender_is_self);
void Stop();
signals:
void SignalClosure(StdClosure);
private slots:
void SlotClosure(StdClosure);
private:
HeartbeatHelper(const CommandHandlerWeakPtr& command_handler);
void HandleMasterHeartbeatCommand(const CommandSharedPtr& cmd_ptr, bool sender_is_self);
private:
MyWeakCallbackFlag heartbeat_flag_;
CommandHandlerWeakPtr command_handler_; // use weak_ptr to avoid circular reference between objects of HeartbeatHelper and CommandHandler
};
GAME_NAMESPACE_END
#endif | [
"993925668@qq.com"
] | 993925668@qq.com |
16332f019ec28145dce7f0a6f829a4f92f9ff04b | 00d5cd399405500ffef11d4d17b43b836cb5c964 | /src/stirling/source_connectors/socket_tracer/protocols/common/always_contiguous_data_stream_buffer_impl.cc | 6ed2801dedff938be31e38f3ed905f1f7ae95561 | [
"Apache-2.0"
] | permissive | doytsujin/pixie | 0b1105105d0f05cf320cdd7bea55c360d1d01925 | cfe6c966fac18ac0c6e4a28b4f51f3be7553e30b | refs/heads/main | 2023-06-10T00:09:33.784394 | 2023-06-06T00:05:07 | 2023-06-06T00:05:07 | 364,398,868 | 0 | 0 | Apache-2.0 | 2021-05-04T22:12:14 | 2021-05-04T22:12:13 | null | UTF-8 | C++ | false | false | 13,156 | cc | /*
* Copyright 2018- The Pixie Authors.
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "src/stirling/source_connectors/socket_tracer/protocols/common/always_contiguous_data_stream_buffer_impl.h"
namespace px {
namespace stirling {
namespace protocols {
namespace {
// Get element <= key in a map.
template <typename TMapType>
typename TMapType::const_iterator MapLE(const TMapType& map, size_t key) {
auto iter = map.upper_bound(key);
if (iter == map.begin()) {
return map.cend();
}
--iter;
return iter;
}
} // namespace
void AlwaysContiguousDataStreamBufferImpl::Reset() {
buffer_.clear();
chunks_.clear();
timestamps_.clear();
position_ = 0;
ShrinkToFit();
}
bool AlwaysContiguousDataStreamBufferImpl::CheckOverlap(size_t pos, size_t size) {
bool left_overlap = false;
bool right_overlap = false;
// Look for the first chunk whose start position is to the right
// of start position of this new chunk.
auto r_iter = chunks_.lower_bound(pos);
if (r_iter != chunks_.end()) {
// There is a chunk to the right. Check for overlap.
size_t r_pos = r_iter->first;
size_t r_size = r_iter->second;
right_overlap = (pos + size > r_pos);
ECHECK(!right_overlap) << absl::Substitute(
"New chunk overlaps with right chunk. "
"Existing right chunk: [p=$0,s=$1] New Chunk: [p=$2,s=$3]",
r_pos, r_size, pos, size);
}
// Find the chunk right before the right chunk. If it exists, this should
// be our left chunk.
auto l_iter = r_iter;
if (l_iter != chunks_.begin()) {
--l_iter;
// There is a chunk to the left. Check for overlap.
size_t l_pos = l_iter->first;
size_t l_size = l_iter->second;
left_overlap = (pos < l_pos + l_size);
ECHECK(!left_overlap) << absl::Substitute(
"New chunk overlaps with left chunk. "
"Existing left chunk: [p=$0,s=$1] New Chunk: [p=$2,s=$3]",
l_pos, l_size, pos, size);
}
return left_overlap || right_overlap;
}
void AlwaysContiguousDataStreamBufferImpl::AddNewChunk(size_t pos, size_t size) {
// Look for the chunks to the left and right of this new chunk.
auto r_iter = chunks_.lower_bound(pos);
auto l_iter = r_iter;
if (l_iter != chunks_.begin()) {
--l_iter;
}
// Does this chunk fuse with the chunk on the left of it?
bool left_fuse = false;
if (l_iter != chunks_.end()) {
size_t l_pos = l_iter->first;
size_t l_size = l_iter->second;
left_fuse = (l_pos + l_size == pos);
}
// Does this chunk fuse with the chunk on the right of it?
bool right_fuse = false;
if (r_iter != chunks_.end()) {
size_t r_pos = r_iter->first;
right_fuse = (pos + size == r_pos);
}
if (left_fuse && right_fuse) {
// The new chunk bridges two previously separate chunks together.
// Keep the left one and increase its size to cover all three chunks.
l_iter->second += (size + r_iter->second);
chunks_.erase(r_iter);
} else if (left_fuse) {
// Merge new chunk directly to the one on its left.
l_iter->second += size;
} else if (right_fuse) {
// Merge new chunk into the one on its right.
// Since its key changes, this requires removing and re-inserting the node.
auto node = chunks_.extract(r_iter);
node.key() = pos;
node.mapped() += size;
chunks_.insert(std::move(node));
} else {
// No fusing, so just add the new chunk.
chunks_[pos] = size;
}
}
void AlwaysContiguousDataStreamBufferImpl::AddNewTimestamp(size_t pos, uint64_t timestamp) {
timestamps_[pos] = timestamp;
}
void AlwaysContiguousDataStreamBufferImpl::Add(size_t pos, std::string_view data,
uint64_t timestamp) {
if (data.size() > capacity_) {
size_t oversize_amount = data.size() - capacity_;
data.remove_prefix(oversize_amount);
pos += oversize_amount;
}
// Calculate physical positions (ppos) where the data would live in the physical buffer.
ssize_t ppos_front = pos - position_;
ssize_t ppos_back = pos + data.size() - position_;
bool run_metadata_cleanup = false;
if (ppos_back <= 0) {
// Case 1: Data being added is too far back. Just ignore it.
// This has been observed to happen a lot on initial deployment,
// where a large batch of events, with cumulative size greater than the buffer size
// arrive in scrambled order.
VLOG(1) << absl::Substitute(
"Ignoring event that has already been skipped [event pos=$0, current pos=$1].", pos,
position_);
return;
} else if (ppos_front < 0) {
// Case 2: Data being added is straddling the front-side of the buffer. Cut-off the prefix.
VLOG(1) << absl::Substitute(
"Event is partially too far in the past [event pos=$0, current pos=$1].", pos, position_);
ssize_t prefix = 0 - ppos_front;
data.remove_prefix(prefix);
pos += prefix;
ppos_front = 0;
} else if (ppos_back > static_cast<ssize_t>(buffer_.size())) {
// Case 3: Data being added extends the buffer. Resize the buffer.
// Subcase: If the data is more than max_gap_size_ ahead of the last chunk in the buffer (or
// more than max_gap_size_ ahead of position_ if there aren't any chunks) than we give up on the
// data currently in the buffer, and stick the new data `allow_before_gap_size_` bytes from the
// front of the buffer. This allows `allow_before_gap_size_` bytes of new data to come in out of
// order after this event that caused the gap.
if (pos > EndPosition() + max_gap_size_) {
position_ = pos - allow_before_gap_size_;
ppos_front = allow_before_gap_size_;
ppos_back = allow_before_gap_size_ + data.size();
// Delay cleaning up metadata until after adding the new chunk, so that `CleanupMetadata`'s
// view of buffer_ and chunks_ is not in an intermediate state.
run_metadata_cleanup = true;
}
if (pos > position_ + capacity_) {
// This has been observed to happen a lot on initial deployment,
// where a large batch of events, with cumulative size greater than the buffer size
// arrive in scrambled order.
VLOG(1) << absl::Substitute("Event skips ahead *a lot* [event pos=$0, current pos=$1].", pos,
position_);
}
ssize_t logical_size = pos + data.size() - position_;
if (logical_size > static_cast<ssize_t>(capacity_)) {
// The movement of the buffer position will cause some bytes to "fall off",
// remove those now.
size_t remove_count = logical_size - capacity_;
VLOG(1) << absl::Substitute("Event bytes to be dropped [count=$0].", remove_count);
RemovePrefix(remove_count);
ppos_front -= remove_count;
ppos_back -= remove_count;
}
DCHECK_GE(ppos_front, 0);
DCHECK_LE(ppos_front, static_cast<ssize_t>(capacity_));
DCHECK_GE(ppos_back, 0);
DCHECK_LE(ppos_back, static_cast<ssize_t>(capacity_));
ssize_t new_size = ppos_back;
DCHECK_LE(new_size, static_cast<ssize_t>(capacity_));
DCHECK_GE(new_size, 0);
buffer_.resize(new_size);
DCHECK_GE(buffer_.size(), 0U);
DCHECK_LE(buffer_.size(), capacity_);
} else {
// Case 4: Data being added is completely within the buffer. Write it directly.
// No adjustments required.
}
if (CheckOverlap(pos, data.size())) {
// This chunk overlaps with an existing chunk. Don't add the new chunk.
return;
}
// Now copy the data into the buffer.
memcpy(buffer_.data() + ppos_front, data.data(), data.size());
// Update the metadata.
AddNewChunk(pos, data.size());
AddNewTimestamp(pos, timestamp);
if (run_metadata_cleanup) {
CleanupMetadata();
}
}
std::map<size_t, size_t>::const_iterator AlwaysContiguousDataStreamBufferImpl::GetChunkForPos(
size_t pos) const {
// Get chunk which is <= pos.
auto iter = MapLE(chunks_, pos);
if (iter == chunks_.cend()) {
return chunks_.cend();
}
DCHECK_GE(pos, iter->first);
// Does the chunk include pos? If not, return {}.
ssize_t available = iter->second - (pos - iter->first);
if (available <= 0) {
return chunks_.cend();
}
return iter;
}
std::string_view AlwaysContiguousDataStreamBufferImpl::Get(size_t pos) const {
auto iter = GetChunkForPos(pos);
if (iter == chunks_.cend()) {
return {};
}
size_t chunk_pos = iter->first;
size_t chunk_size = iter->second;
ssize_t bytes_available = chunk_size - (pos - chunk_pos);
DCHECK_GT(bytes_available, 0);
DCHECK_GE(pos, position_);
size_t ppos = pos - position_;
DCHECK_LT(ppos, buffer_.size());
return std::string_view(buffer_.data() + ppos, bytes_available);
}
StatusOr<uint64_t> AlwaysContiguousDataStreamBufferImpl::GetTimestamp(size_t pos) const {
// Ensure the specified time corresponds to a real chunk.
if (GetChunkForPos(pos) == chunks_.cend()) {
return error::Internal("Specified position not found");
}
// Get chunk which is <= pos.
auto iter = MapLE(timestamps_, pos);
if (iter == timestamps_.cend()) {
LOG(DFATAL) << absl::Substitute(
"Specified position should have been found, since we verified we are not in a chunk gap "
"[position=$0]\n$1.",
pos, DebugInfo());
return error::Internal("Specified position not found.");
}
DCHECK_GE(pos, iter->first);
return iter->second;
}
void AlwaysContiguousDataStreamBufferImpl::CleanupMetadata() {
CleanupChunks();
CleanupTimestamps();
}
void AlwaysContiguousDataStreamBufferImpl::CleanupChunks() {
// Find and remove irrelevant metadata in `chunks_`.
// Get chunk which is <= position_.
auto iter = MapLE(chunks_, position_);
if (iter == chunks_.cend()) {
return;
}
size_t chunk_pos = iter->first;
size_t chunk_size = iter->second;
DCHECK_GE(position_, chunk_pos);
ssize_t available = chunk_size - (position_ - chunk_pos);
if (available <= 0) {
// position_ was in a gap area between two chunks, so go back to the next chunk.
++iter;
chunks_.erase(chunks_.begin(), iter);
} else {
// Remove all chunks entirely before position_.
chunks_.erase(chunks_.begin(), iter);
// Adjust the first chunk's size.
DCHECK(!chunks_.empty());
auto node = chunks_.extract(chunks_.begin());
node.key() = position_;
node.mapped() = available;
chunks_.insert(std::move(node));
}
if (chunks_.empty()) {
ECHECK(buffer_.empty()) << "Invalid state in AlwaysContiguousDataStreamBufferImpl. "
"buffer_ is non-empty, but chunks_ is empty.";
buffer_.clear();
}
}
void AlwaysContiguousDataStreamBufferImpl::CleanupTimestamps() {
// Find and remove irrelevant metadata in `timestamps_`.
// Get timestamp which is <= position_.
auto iter = MapLE(timestamps_, position_);
if (iter == timestamps_.cend()) {
return;
}
// We are now at the timestamp that covers position_,
// anything before this is expired and can be removed.
timestamps_.erase(timestamps_.begin(), iter);
DCHECK(!timestamps_.empty());
}
void AlwaysContiguousDataStreamBufferImpl::RemovePrefix(ssize_t n) {
// Check for positive values of n.
// For safety in production code, just return.
DCHECK_GE(n, 0);
if (n < 0) {
return;
}
buffer_.erase(0, n);
position_ += n;
CleanupMetadata();
}
void AlwaysContiguousDataStreamBufferImpl::Trim() {
if (chunks_.empty()) {
return;
}
auto& chunk_pos = chunks_.begin()->first;
DCHECK_GE(chunk_pos, position_);
size_t trim_size = chunk_pos - position_;
buffer_.erase(0, trim_size);
position_ += trim_size;
}
size_t AlwaysContiguousDataStreamBufferImpl::EndPosition() {
size_t end_position = position_;
if (!chunks_.empty()) {
auto last_chunk = std::prev(chunks_.end());
end_position = last_chunk->first + last_chunk->second;
}
return end_position;
}
std::string AlwaysContiguousDataStreamBufferImpl::DebugInfo() const {
std::string s;
absl::StrAppend(&s, absl::Substitute("Position: $0\n", position_));
absl::StrAppend(&s, absl::Substitute("BufferSize: $0/$1\n", buffer_.size(), capacity_));
absl::StrAppend(&s, "Chunks:\n");
for (const auto& [pos, size] : chunks_) {
absl::StrAppend(&s, absl::Substitute(" position:$0 size:$1\n", pos, size));
}
absl::StrAppend(&s, "Timestamps:\n");
for (const auto& [pos, timestamp] : timestamps_) {
absl::StrAppend(&s, absl::Substitute(" position:$0 timestamp:$1\n", pos, timestamp));
}
absl::StrAppend(&s, absl::Substitute("Buffer: $0\n", buffer_));
return s;
}
} // namespace protocols
} // namespace stirling
} // namespace px
| [
"copybara@pixielabs.ai"
] | copybara@pixielabs.ai |
e68be35ae581b8e1a2c13468173e18bb01fb9663 | b86d7ba26f9ec19fcd29a03370870c1b41de6d6a | /RigidBodies/PhysicsProject/Color.h | 236b516643a09a93e568b8dd1192fa5446c482ef | [
"MIT"
] | permissive | mattstruble/PhysicSimulations | 68f1583a7568e4462f2fa6220555cd89ce2f4121 | 29e6b4c07a9faed5997a0023e953bf345f2e7323 | refs/heads/master | 2021-01-18T21:30:47.030298 | 2016-03-28T01:06:39 | 2016-03-28T01:06:39 | 30,939,833 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,500 | h | //======================================================================
//File: Color.h
//Author: Matt Struble
//======================================================================
#ifndef COLOR_H
#define COLOR_H
//======================================================================
#pragma once
//======================================================================
#include <GL\glut.h>
//======================================================================
struct Color
{
float R, G, B, A;
Color() {}
Color(float r, float g, float b, float a = 255)
{
R = r;
G = g;
B = b;
A = a;
}
void ConvertToDecimal()
{
R /= 255;
G /= 255;
B /= 255;
}
Color operator&=(const Color& rhs)
{
R = rhs.R;
G = rhs.G;
B = rhs.B;
}
bool operator==(const Color& rhs)
{
return R == rhs.R && B == rhs.B && G == rhs.G;
}
Color operator/(const Color& rhs)
{
return Color(R / rhs.R, G / rhs.G, B / rhs.B, A / rhs.A);
}
static const struct Color RED;
static const struct Color BLUE;
static const struct Color GREEN;
static const struct Color YELLOW;
static const struct Color ORANGE;
static const struct Color MAGENTA;
static const struct Color WHITE;
static const struct Color BLACK;
static const struct Color TURQUOISE;
static const struct Color AZURE;
static const struct Color LIME;
static const struct Color CORNFLOWERBLUE;
static const struct Color GREY;
static const struct Color RANDOM;
private:
static const struct Color DEFAULT;
};
#endif | [
"mattstruble@outlook.com"
] | mattstruble@outlook.com |
72457479036a1a47c85a990cdd9261fccac0eee4 | e059e089ba8e5c83080930cdf337ca7968e43aa3 | /source/ReferenceDejaPresenteException.cpp | 88bd32a71cedc3dfe2b73a29a02e4a659bd6be96 | [] | no_license | YAZAH/Gestion-biblio | eba96f3cc9551e3b0597a7c9bea002eef67c44c7 | ae78087b0f3bde3203706d97176fb0b97cb51266 | refs/heads/master | 2021-05-09T05:38:50.547700 | 2018-01-29T01:32:44 | 2018-01-29T01:32:44 | 118,982,245 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 352 | cpp | /*
* ReferenceDejaPresenteException.cpp
*
* Created on: 2016-04-19
* Author: etudiant
*/
#include "ReferenceDejaPresenteException.h"
namespace tp {
ReferenceDejaPresenteException::ReferenceDejaPresenteException(const std::string& p_raison):ReferenceException(p_raison) {
// TODO Auto-generated constructor stub
}
} /* namespace tp */
| [
"yzaho037@uottawa.ca"
] | yzaho037@uottawa.ca |
d63661bf7f1dcb386a62a535deb20dffa3bcfc61 | db6903560e8c816b85b9adec3187f688f8e40289 | /VisualUltimate/WindowsSDKs/vc7/atlmfc/src/mfc/appui1.cpp | eae1e1a41ace8d4a96c4860f398213d4d9b66706 | [] | no_license | QianNangong/VC6Ultimate | 846a4e610859fab5c9d8fb73fa5c9321e7a2a65e | 0c74cf644fbdd38018c8d94c9ea9f8b72782ef7c | refs/heads/master | 2022-05-05T17:49:52.120385 | 2019-03-07T14:46:51 | 2019-03-07T14:46:51 | 147,986,727 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,451 | cpp | // This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#ifdef AFX_CORE3_SEG
#pragma code_seg(AFX_CORE3_SEG)
#endif
/////////////////////////////////////////////////////////////////////////////
// CWinApp UI related functions
void CWinApp::EnableModeless(BOOL bEnable)
{
#ifdef _AFX_NO_OLE_SUPPORT
UNUSED(bEnable);
#endif
// no-op if main window is NULL or not a CFrameWnd
CWnd* pMainWnd = AfxGetMainWnd();
if (pMainWnd == NULL || !pMainWnd->IsFrameWnd())
return;
#ifndef _AFX_NO_OLE_SUPPORT
// check if notify hook installed
ASSERT_KINDOF(CFrameWnd, pMainWnd);
CFrameWnd* pFrameWnd = (CFrameWnd*)pMainWnd;
if (pFrameWnd->m_pNotifyHook != NULL)
pFrameWnd->m_pNotifyHook->OnEnableModeless(bEnable);
#endif
}
int CWinApp::DoMessageBox(LPCTSTR lpszPrompt, UINT nType, UINT nIDPrompt)
{
// disable windows for modal dialog
EnableModeless(FALSE);
HWND hWndTop;
HWND hWnd = CWnd::GetSafeOwner_(NULL, &hWndTop);
// WINBUG: re-enable the parent window, so that focus is restored
// correctly when the dialog is dismissed.
if (hWnd != hWndTop)
EnableWindow(hWnd, TRUE);
// set help context if possible
DWORD* pdwContext = NULL;
if (hWnd != NULL)
{
// use app-level context or frame level context
LRESULT lResult = ::SendMessage(hWnd, WM_HELPPROMPTADDR, 0, 0);
if (lResult != 0)
pdwContext = (DWORD*)lResult;
}
// for backward compatibility use app context if possible
if (pdwContext == NULL && this != NULL)
pdwContext = &m_dwPromptContext;
DWORD dwOldPromptContext = 0;
if (pdwContext != NULL)
{
// save old prompt context for restoration later
dwOldPromptContext = *pdwContext;
if (nIDPrompt != 0)
*pdwContext = HID_BASE_PROMPT+nIDPrompt;
}
// determine icon based on type specified
if ((nType & MB_ICONMASK) == 0)
{
switch (nType & MB_TYPEMASK)
{
case MB_OK:
case MB_OKCANCEL:
nType |= MB_ICONEXCLAMATION;
break;
case MB_YESNO:
case MB_YESNOCANCEL:
nType |= MB_ICONEXCLAMATION;
break;
case MB_ABORTRETRYIGNORE:
case MB_RETRYCANCEL:
// No default icon for these types, since they are rarely used.
// The caller should specify the icon.
break;
}
}
#ifdef _DEBUG
if ((nType & MB_ICONMASK) == 0)
TRACE(traceAppMsg, 0, "Warning: no icon specified for message box.\n");
#endif
TCHAR szAppName[_MAX_PATH];
szAppName[0] = '\0';
LPCTSTR pszAppName;
if (this != NULL)
pszAppName = m_pszAppName;
else
{
pszAppName = szAppName;
DWORD dwLen = GetModuleFileName(NULL, szAppName, _MAX_PATH);
if (dwLen == _MAX_PATH)
szAppName[_MAX_PATH - 1] = '\0';
}
int nResult =
::MessageBox(hWnd, lpszPrompt, pszAppName, nType);
// restore prompt context if possible
if (pdwContext != NULL)
*pdwContext = dwOldPromptContext;
// re-enable windows
if (hWndTop != NULL)
::EnableWindow(hWndTop, TRUE);
EnableModeless(TRUE);
return nResult;
}
int AFXAPI AfxMessageBox(LPCTSTR lpszText, UINT nType, UINT nIDHelp)
{
CWinApp* pApp = AfxGetApp();
if (pApp != NULL)
return pApp->DoMessageBox(lpszText, nType, nIDHelp);
else
return pApp->CWinApp::DoMessageBox(lpszText, nType, nIDHelp);
}
int AFXAPI AfxMessageBox(UINT nIDPrompt, UINT nType, UINT nIDHelp)
{
CString string;
if (!string.LoadString(nIDPrompt))
{
TRACE(traceAppMsg, 0, "Error: failed to load message box prompt string 0x%04x.\n",
nIDPrompt);
ASSERT(FALSE);
}
if (nIDHelp == (UINT)-1)
nIDHelp = nIDPrompt;
return AfxMessageBox(string, nType, nIDHelp);
}
////////////////////////////////////////////////////////////////////////////
// UI related CWnd functions
HWND PASCAL CWnd::GetSafeOwner_(HWND hParent, HWND* pWndTop)
{
// get window to start with
HWND hWnd = hParent;
if (hWnd == NULL)
{
CFrameWnd* pFrame = CCmdTarget::GetRoutingFrame_();
if (pFrame != NULL)
hWnd = pFrame->GetSafeHwnd();
else
hWnd = AfxGetMainWnd()->GetSafeHwnd();
}
// a popup window cannot be owned by a child window
while (hWnd != NULL && (::GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD))
hWnd = ::GetParent(hWnd);
// determine toplevel window to disable as well
HWND hWndTop = hWnd, hWndTemp = hWnd;
for (;;)
{
if (hWndTemp == NULL)
break;
else
hWndTop = hWndTemp;
hWndTemp = ::GetParent(hWndTop);
}
// get last active popup of first non-child that was found
if (hParent == NULL && hWnd != NULL)
hWnd = ::GetLastActivePopup(hWnd);
// disable and store top level parent window if specified
if (pWndTop != NULL)
{
if (hWndTop != NULL && ::IsWindowEnabled(hWndTop) && hWndTop != hWnd)
{
*pWndTop = hWndTop;
::EnableWindow(hWndTop, FALSE);
}
else
*pWndTop = NULL;
}
return hWnd; // return the owner as HWND
}
/////////////////////////////////////////////////////////////////////////////
// UI related CCmdTarget functions
CView* PASCAL CCmdTarget::GetRoutingView_()
{
CView* pView = AfxGetThreadState()->m_pRoutingView;
return pView;
}
CFrameWnd* PASCAL CCmdTarget::GetRoutingFrame_()
{
CFrameWnd* pFrame = AfxGetThreadState()->m_pRoutingFrame;
return pFrame;
}
/////////////////////////////////////////////////////////////////////////////
| [
"vc6@ultim.pw"
] | vc6@ultim.pw |
616f2accd7c6424a06ccf79f90725a26496e61c4 | 1ad310fc8abf44dbcb99add43f6c6b4c97a3767c | /samples_c++/cc/sprite_anime/App.cc | 38349b73dbc2e97f10ca3d59a78e2db2ddd4a7e1 | [] | no_license | Jazzinghen/spamOSEK | fed44979b86149809f0fe70355f2117e9cb954f3 | 7223a2fb78401e1d9fa96ecaa2323564c765c970 | refs/heads/master | 2020-06-01T03:55:48.113095 | 2010-05-19T14:37:30 | 2010-05-19T14:37:30 | 580,640 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,717 | cc | #include "App.h"
//the sprite graphics frames
extern const char shiki_intro_spr_start[];
extern const char shiki_walkforward_spr_start[];
extern const char shiki_taunt_spr_start[];
extern const char shiki_breathe_spr_start[];
//the set of all of the sprites
const char* shikiDataSet[] =
{
shiki_intro_spr_start,
shiki_walkforward_spr_start,
shiki_taunt_spr_start,
shiki_breathe_spr_start,
};
//anim command come in pairs of 2 (frame number, time in 20msec) or (anim command, parameter)
const char shikiAppearAnim[] = {0,3,1,3,2,3,3,3,4,3,5,3,254,0};
const char shikiWalkAnim[] = {0,3,1,3,2,3,3,3,4,3,5,3,253,1,0,3,1,3,2,3,3,3,4,3,5,3,255,0};
const char shikiTauntAnim[] = {0,3,1,3,2,3,0,3,1,3,2,3,0,3,1,3,2,3,0,3,1,3,2,3,0,3,1,3,2,3,255,0};
const char shikiBreatheAnim[] = {0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,255,0};
//the set of all animations for shiki since we'll be chaining them together
const char* shikiAnimset[] =
{
shikiAppearAnim,
shikiWalkAnim,
shikiTauntAnim,
shikiBreatheAnim
};
App::App()
: mCurrentAnim(0)
, mShiki(shikiDataSet[0], shikiAnimset[0])
{
mShiki.setScriptInterface(this);
mShiki.setID(eSprite_Shiki);
}
void App::init()
{
mScreen.newSprite(&mShiki);
}
//run animation actions on the sprites as they call new commands
void App::animCommand(Sprite *sprite, int command)
{
switch(sprite->getID())
{
case eSprite_Shiki:
runShikiAnim(sprite, command);
break;
}
}
void App::runShikiAnim(Sprite *sprite, int command)
{
if(++mCurrentAnim == 4)
{
mCurrentAnim = 0;
}
sprite->changeGfx(shikiDataSet[mCurrentAnim], shikiAnimset[mCurrentAnim]);
}
void App::update()
{
mScreen.update();
}
| [
"jazzinghen@Jehuty.(none)"
] | jazzinghen@Jehuty.(none) |
1863983baeb44038dcba93463ba3cdba83aeabb2 | 927442d1aadd124d1ec5b5a56b3c442ba2735841 | /08_cocos2d-x/day04/Demo2/Plane/Plane/Classes/GameScene.cpp | cdea115af06e60c7bb74dea27607fde677a2441e | [] | no_license | yitian630/Tarena | 2dc2fd276e1404330222d28fb10ddd0116eca74b | 49b587ab58cb5e173d6dcd2701ea6db3b35cdf0b | refs/heads/master | 2021-01-22T02:49:19.160833 | 2015-03-12T06:58:26 | 2015-03-12T06:58:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 741 | cpp | //
// GameScene.cpp
// Plane
//
// Created by tarena on 14-6-10.
//
//
#include "GameScene.h"
#include "MapLayer.h"
#include "SpriteLayer.h"
GameScene* GameScene::createGameScene(int level) {
GameScene *scene = new GameScene();
if (scene && scene->initGameScene(level)) {
scene->autorelease();
return scene;
}
CC_SAFE_DELETE(scene);
return NULL;
}
bool GameScene::initGameScene(int level) {
if (!CCScene::init()) return false;
//添加 背景层
MapLayer *mapLayer = MapLayer::createMapLayer(level);
this->addChild(mapLayer);
//创建精灵层
Spritelayer *spriteLayer = Spritelayer::create();
this->addChild(spriteLayer);
return true;
}
| [
"yitian630@163.com"
] | yitian630@163.com |
4c84525ac45cdaaf61f8624de9785ad88de5832c | af69e335fc0ff9632964d061833713b672abad01 | /Temp/StagingArea/Data/il2cppOutput/mscorlib_System_Runtime_Remoting_Contexts_DynamicPr652373272.h | 10608437c6a0daff268ce0d7a555a485a8a1c990 | [] | no_license | PruthvishMShirur/Solar-System | ca143ab38cef582705f0beb76f7fef8b28e25ef9 | 5cf3eaa66949801aa9a34cd3cf80eeefa64d2342 | refs/heads/master | 2023-05-26T17:53:37.489349 | 2021-06-16T19:56:48 | 2021-06-16T19:56:48 | 377,611,177 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,252 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Object3080106164.h"
// System.Collections.ArrayList
struct ArrayList_t2718874744;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Runtime.Remoting.Contexts.DynamicPropertyCollection
struct DynamicPropertyCollection_t652373272 : public Il2CppObject
{
public:
// System.Collections.ArrayList System.Runtime.Remoting.Contexts.DynamicPropertyCollection::_properties
ArrayList_t2718874744 * ____properties_0;
public:
inline static int32_t get_offset_of__properties_0() { return static_cast<int32_t>(offsetof(DynamicPropertyCollection_t652373272, ____properties_0)); }
inline ArrayList_t2718874744 * get__properties_0() const { return ____properties_0; }
inline ArrayList_t2718874744 ** get_address_of__properties_0() { return &____properties_0; }
inline void set__properties_0(ArrayList_t2718874744 * value)
{
____properties_0 = value;
Il2CppCodeGenWriteBarrier(&____properties_0, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"42893637+PruthvishMShirur@users.noreply.github.com"
] | 42893637+PruthvishMShirur@users.noreply.github.com |
8395f55a2870413c9ac218f1f72f09c0eeaadf13 | b2263008c8d6159b3a2253ec237eb7dc71e2e4b2 | /libs/Flow/test/Flow/Components/TestConstant.cpp | 07f403b7dbe9e9e9435bb47d09fabc392a14dd0c | [] | no_license | mckelley3v/BlackBox | 32daa66cbccd2b47577854b887bf51af8a5bbab9 | 005339363962347c6aa484403db04c08fe0469c7 | refs/heads/master | 2021-01-23T14:03:45.035245 | 2017-08-27T19:26:21 | 2017-08-27T19:26:21 | 23,777,405 | 0 | 0 | null | 2014-11-06T16:20:07 | 2014-09-08T02:51:51 | C++ | UTF-8 | C++ | false | false | 738 | cpp | #include "Flow/Components/Constant.hpp"
#include "Flow/TypeManager.hpp"
#include "catch.hpp"
TEST_CASE("Test Flow::Components::Constant", "[Flow]")
{
using namespace Flow;
using namespace Flow::Components;
TypeManager const type_manager
{{
// ComponentTypes
{
Constant<float>::GetComponentTypeEntry(),
},
// ConnectionTypes
{
// Name BaseNames
{ "bool", {}},
{ "int", {}},
{ "float", {}},
},
}};
Constant<float> const_one(type_manager, "one", {}, 1.0f);
CHECK(GetOutputConnectionPtr<float>(const_one, "Value") == &const_one.GetValue());
CHECK(const_one.GetValue() == 1.0f);
}
| [
"mckelley3v@gmail.com"
] | mckelley3v@gmail.com |
e9fe0c26b4ff71de5ac2ac6bdfa1b2a369643326 | f42f97a97a0b446dd793ed33430a4db048643a80 | /test/test_observer.cpp | 0cab8e8f5cb9fa0748497e1e5cf5994b0a4c2267 | [] | no_license | Dwillnio/ConBox | b729066415cca6eeec1d5500ee5d57ae90c83974 | a361359cbebfcbe274ec07381e44c83c3acad745 | refs/heads/master | 2022-11-13T23:06:13.270975 | 2020-07-12T14:06:04 | 2020-07-12T14:06:04 | 268,073,456 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,192 | cpp | #include "test_observer.h"
void luenberger_observer_test_1(int argc, char** argv, std::ostream& os)
{
rnum d_t = 0.01;
rnum y_target = -2;
linear_system osc = harm_osc();
//func_dgl_p func(func_osc_contrl, 2, 1, 0);
const_function w_func(y_target, 1, 1);
state_controller contr(2, 1, 0, 1, matrix(std::vector<rnum>{0,18},1));
vec x_start(2);
x_start[0] = 1;
x_start[1] = 0;
dgl_rungekutta solver(d_t, &osc);
stationary_filter filt(1,1, matrix(std::vector<rnum>{10},1));
luenberger_observer obs(vec({5,5}), d_t, osc.A_mat(), osc.B_mat(), osc.C_mat(), matrix({9.8,22.04}, 2));
simulator_obs sim(&solver, &osc, &contr, x_start, d_t, 50, &filt, &obs, &w_func);
sim.run();
std::vector<time_value> x_result = sim.get_xresult();
std::vector<time_value> u_result = sim.get_uresult();
std::vector<time_value> x_est_result = sim.get_x_estimates();
visualizer display(argc, argv);
//display.visualize_result(&u_result, 0, &x_result, 0);
display.visualize_result(x_result, std::vector<nnum>({0,1}), u_result, std::vector<nnum>({0}),
x_result, std::vector<nnum>({0}), x_est_result);
}
| [
"dwillnio@gmx.de"
] | dwillnio@gmx.de |
5f8bf6240d92fefb8d8379a72e31fabe2e0c2b6c | 0757032a90e634df8fecbf4687cbf30eb60b5092 | /src/test/test-multiplication.cpp | 94a99c3b1f1130ce4d41aa121e4c62568958b8af | [
"MIT",
"GPL-1.0-or-later",
"Apache-2.0"
] | permissive | A-Pisani/MK-TFHE | b28ab4847177d9b5a39fe317dfd2bbd536429fc9 | 76d7e658af4bc2343210d4549d07d2743d56a313 | refs/heads/master | 2023-07-15T15:49:04.024892 | 2021-08-29T09:32:47 | 2021-08-29T09:32:47 | 372,584,100 | 1 | 0 | Apache-2.0 | 2021-08-29T15:41:37 | 2021-05-31T17:34:39 | C++ | UTF-8 | C++ | false | false | 3,748 | cpp | #include <stdio.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <sys/time.h>
#include "tfhe.h"
#include "polynomials.h"
using namespace std;
// **********************************************************************************
// ********************************* MAIN *******************************************
// **********************************************************************************
void dieDramatically(string message) {
cerr << message << endl;
abort();
}
int32_t main(int32_t argc, char **argv) {
const int32_t count = 1000; //number of tests to compare the 3 types of multiplication
const int32_t N = 1024;
IntPolynomial *a = new_IntPolynomial(N);
TorusPolynomial *b = new_TorusPolynomial(N);
TorusPolynomial *resNaive = new_TorusPolynomial(N);
TorusPolynomial *resFFT = new_TorusPolynomial(N);
TorusPolynomial *resKaratsuba = new_TorusPolynomial(N);
//LagrangeHalfCPolynomial* test_fft = new_LagrangeHalfCPolynomial(N);
double cycles_naive[count];
double cycles_karatsuba[count];
double cycles_fft[count];
for (int32_t i = 0; i < count; ++i) {
for (int32_t i = 0; i < N; i++) {
a->coefs[i] = (rand() % (4 * N)) - (2 * N);
b->coefsT[i] = rand();
}
//measure the execution time
clock_t cstart, cend;
cstart = clock();
torusPolynomialMultNaive(resNaive, a, b);
cend = clock();
cycles_naive[i] = cend - cstart;
cstart = clock();
torusPolynomialMultKaratsuba(resKaratsuba, a, b);
cend = clock();
cycles_karatsuba[i] = cend - cstart;
cstart = clock();
torusPolynomialMultFFT(resFFT, a, b);
//TorusPolynomial_ifft(test_fft,resNaive);
//TorusPolynomial_fft(resFFT,test_fft);
cend = clock();
cycles_fft[i] = cend - cstart;
for (int32_t i = 0; i < N; i++) {
if (abs(int32_t(resNaive->coefsT[i] - resFFT->coefsT[i])) > 1) {
cerr << i << " " << resNaive->coefsT[i] << " vs. " << resFFT->coefsT[i] << endl;
dieDramatically("Naive != FFT\n");
}
}
for (int32_t i = 0; i < N; i++) {
if (abs(int32_t(resNaive->coefsT[i] - resKaratsuba->coefsT[i])) > 1) {
cerr << i << " " << resNaive->coefsT[i] << " vs. " << resKaratsuba->coefsT[i] << endl;
dieDramatically("Naive != Karatsuba\n");
}
}
}
// computing the average number of cycles per type of multiplication
double cyc_naive = 0;
double cyc_karatsuba = 0;
double cyc_fft = 0;
for (int32_t i = 0; i < count; ++i) {
cyc_naive += cycles_naive[i];
cyc_karatsuba += cycles_karatsuba[i];
cyc_fft += cycles_fft[i];
}
cyc_naive = cyc_naive / count;
cyc_karatsuba = cyc_karatsuba / count;
cyc_fft = cyc_fft / count;
cout << "torusPolynomialMultNaive: " << cyc_naive << " clock cycles (average)" << endl;
cout << "torusPolynomialMultNaive time: " << (cyc_naive / CLOCKS_PER_SEC) << " seconds" << endl;
cout << endl;
cout << "torusPolynomialMultKaratsuba: " << cyc_karatsuba << " clock cycles (average)" << endl;
cout << "torusPolynomialMultKaratsuba time: " << (cyc_karatsuba / CLOCKS_PER_SEC) << " seconds" << endl;
cout << endl;
cout << "torusPolynomialMultFFT: " << cyc_fft << " clock cycles (average)" << endl;
cout << "torusPolynomialMultFFT time: " << (cyc_fft / CLOCKS_PER_SEC) << " seconds" << endl;
cout << endl;
delete_IntPolynomial(a);
delete_TorusPolynomial(b);
delete_TorusPolynomial(resNaive);
delete_TorusPolynomial(resKaratsuba);
return 0;
}
| [
"ilaria.chillotti@uvsq.fr"
] | ilaria.chillotti@uvsq.fr |
7fb6d208d1dea0030e225f6237becc81a95329ea | 3b6185d3052764481e4b6dff75ab9a6ed34d1cef | /Solutions/question_119.cpp | 1bc872b8320b5e3059f0ac040fabfb64ab8a342b | [] | no_license | niaokedaoren/LeetCode_Solution | a01a8a7ffcd80c165a705bb712a2c75509464ac0 | 91be5d8bfc98b0efa76d92c2cdf4edb6fd0d3a03 | refs/heads/master | 2016-08-07T20:41:29.852161 | 2013-10-16T11:07:40 | 2013-10-16T11:07:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 397 | cpp | class Solution {
public:
vector<int> getRow(int rowIndex) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
vector<int> row;
if (rowIndex < 0)
return row;
row.push_back(1);
for (int i=0; i<rowIndex; i++) {
row.push_back(1);
for (int n=row.size()-2; n>0; n--) {
row[n] += row[n-1];
}
}
return row;
}
};
| [
"gorgeousabalone@gmail.com"
] | gorgeousabalone@gmail.com |
4fb726fc3071dd97d4d5be9ea8719c85b6d0d577 | b50c6816c6ae139851f2c3f47a320237ee0c358c | /source/overlay[dll]/osd.cpp | f4dda8c5370af1b9a3a9e93b30b77e73d7baa379 | [
"MIT"
] | permissive | ivanpos2015/Push | e2725aeb0058c29548d427b380c34229cbd0a16a | a595f40dfecc233ebeae10a6ef513468972409b7 | refs/heads/master | 2020-04-13T03:42:12.914029 | 2018-11-14T07:15:39 | 2018-11-14T07:15:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,061 | cpp | #include <Windows.h>
#include <time.h>
#include <stdio.h>
#include "overlay.h"
#include "osd.h"
extern UINT32 BackBufferWidth;
extern UINT32 BackBufferHeight;
extern UINT32 BackBufferCount;
extern double FrameTimeAvg;
OSD_VARS Variables;
extern BOOLEAN IsStableFrametime;
extern BOOLEAN IsLimitedFrametime;
CPU_CALC_INDEX CPUStrap = CPU_CALC_twc;
/**
* Draws all on-screen display items.
*/
VOID Osd_Draw( OvOverlay* Overlay )
{
UINT8 i;
OSD_ITEM *osdItem;
wchar_t buffer[100];
osdItem = (OSD_ITEM*) PushSharedMemory->OsdItems;
for (i = 0; i < PushSharedMemory->NumberOfOsdItems; i++, osdItem++)
{
//Process specific.
switch (osdItem->Flag)
{
case OSD_DISK_RESPONSE:
osdItem->Value = DiskResponseTime;
swprintf(osdItem->Text, 20, L"DSK : %i ms", osdItem->Value);
break;
default:
break;
}
if (!osdItem->Flag //draw if no flag, could be somebody just wants to display stuff on-screen
|| PushSharedMemory->OSDFlags & osdItem->Flag //if it has a flag, is it set?
|| osdItem->Queue)
{
Overlay->DrawText(osdItem->Text, osdItem->Color);
}
}
if (Variables.GraphicsApi)
{
switch (GraphicsApi)
{
case API_OGL:
Overlay->DrawText(L"API: OGL");
break;
case API_DDRAW:
Overlay->DrawText(L"API: DDRAW");
break;
case API_D3D8:
Overlay->DrawText(L"API: D3D8");
break;
case API_D3D9:
Overlay->DrawText(L"API: D3D9");
break;
case API_D3D10:
Overlay->DrawText(L"API: D3D10");
break;
case API_D3D11:
Overlay->DrawText(L"API: D3D11");
break;
}
}
if (Variables.InputApi)
{
Overlay->DrawText(L"API: lolinput");
}
if (Variables.FrameTime)
{
switch (Variables.FrameTime)
{
case 1:
case 2:
swprintf(buffer, 100, L"Frame Time: %.1f", FrameTimeAvg);
Overlay->DrawText(buffer);
break;
}
}
if (Variables.Resolution)
{
swprintf(buffer, 100, L"Resolution : %i x %i", BackBufferWidth, BackBufferHeight);
Overlay->DrawText(buffer);
}
if (Variables.Buffers)
{
swprintf(buffer, 20, L"Frame Buffers : %i", BackBufferCount);
Overlay->DrawText(buffer);
}
if (!IsStableFramerate || PushSharedMemory->KeepFps)
{
wchar_t buffer[100];
DWORD color;
osdItem->Value = FrameRate;
//swprintf(buffer, 20, L"%i", FrameRate);
swprintf(buffer, 100, L"%.0f", FrameRate);
if (IsStableFrametime)
{
color = 0xFFFFFF00;
if (IsLimitedFrametime)
{
color = 0xFFFFA500;
}
}
else
{
color = 0xFFFF0000;
}
Overlay->DrawText(buffer, color);
}
}
| [
"volks.hb@gmail.com"
] | volks.hb@gmail.com |
3f15045628f3a1f44d97a88b4a577aadbece5f3c | b95d26916dcc2c9e99395eaa02387447f402f069 | /OperatorOverload/IntArray.cpp | 813b4d2c0196f53b89247b6ca3c6247fea568640 | [] | no_license | zhmhClark/cplusplus | 2b4cd80f4a865366b6ac57dfb1ebb7476bb3c062 | a82dbe92fc6b9a8a98008b0805791ec9da9b5558 | refs/heads/master | 2020-05-05T09:51:48.551812 | 2019-04-07T05:02:33 | 2019-04-07T05:02:33 | 179,920,515 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 290 | cpp | #include "IntArray.h"
IntArray::IntArray(int n)
{
arr = new int[n];
size = n;
}
IntArray::~IntArray()
{
}
IntArray & IntArray::operator=(IntArray & ar)
{
size = ar.size;
delete []arr;
arr = new int[ar.size];
for (int i = 0; i < size; i++)
arr[i] = ar.arr[i];
return *this;
}
| [
"778970072@qq.com"
] | 778970072@qq.com |
678c8bdb9932012d621c50c35a0c36c1a5e38c9f | 8fd40775feed5b654ff9337a82922570b095af00 | /packet/packet.cpp | 5ad548d4c0dbccfff3d32e45211fb71c05fb9152 | [
"Apache-2.0"
] | permissive | weixiaopassking/CHCenter | 491f082217652293deeaa72adeb92672062913f7 | 181a9abc1f66288d958fee113e3bdc7a6b921e88 | refs/heads/main | 2023-04-03T21:04:15.147050 | 2021-03-05T03:52:15 | 2021-03-09T04:08:31 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,914 | cpp | #include <string.h>
#include <stdio.h>
#include "packet.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#ifndef CH_OK
#define CH_OK (0)
#endif
#ifndef CH_ERR
#define CH_ERR (1)
#endif
uint32_t frame_count;
static void crc16_update(uint16_t *currect_crc, const uint8_t *src, uint32_t len)
{
uint16_t crc = *currect_crc;
uint16_t j;
for (j=0; j < len; ++j)
{
uint16_t i;
uint16_t byte = src[j];
crc ^= byte << 8;
for (i = 0; i < 8; ++i)
{
uint16_t temp = crc << 1;
if (crc & 0x8000)
{
temp ^= 0x1021;
}
crc = temp;
}
}
*currect_crc = crc;
}
enum status
{
kStatus_Idle,
kStatus_Cmd,
kStatus_LenLow,
kStatus_LenHigh,
kStatus_CRCLow,
kStatus_CRCHigh,
kStatus_Data,
};
/* function pointer */
static on_data_received_event event_handler;
static packet_t *RxPkt;
/**
* @brief 初始化姿态解码模块
* @note 完成初始化一个引脚配置
* @param pkt 接收包指针
* @param 接收成功回调函数
* @code
* void OnDataReceived(Packet_t *pkt)
* {
* pkt->buf 为数据 pkt->payload_len 为接收到的字节长度
* }
*
* Packet_t pkt;
* Packet_DecodeInit(&pkt, OnDataReceived);
* @endcode
* @retval None
*/
void packet_decode_init(packet_t *pkt, on_data_received_event func)
{
event_handler = func;
memset(pkt, 0, sizeof(packet_t));
RxPkt = pkt;
}
/**
* @brief 接收IMU数据
* @note 在串口接收中断中调用此函数
* @param c 串口数据
* @retval CH_OK
*/
uint32_t packet_decode(uint8_t c)
{
static uint16_t CRCReceived = 0; /* CRC value received from a frame */
static uint16_t CRCCalculated = 0; /* CRC value caluated from a frame */
static uint8_t status = kStatus_Idle; /* state machine */
static uint8_t crc_header[4] = {0x5A, 0xA5, 0x00, 0x00};
switch(status)
{
case kStatus_Idle:
if(c == 0x5A)
{
status = kStatus_Cmd;
}
break;
case kStatus_Cmd:
RxPkt->type = c;
if(RxPkt->type == 0xA5)
status = kStatus_LenLow;
break;
case kStatus_LenLow:
RxPkt->payload_len = c;
crc_header[2] = c;
status = kStatus_LenHigh;
break;
case kStatus_LenHigh:
RxPkt->payload_len |= (c<<8);
crc_header[3] = c;
status = kStatus_CRCLow;
break;
case kStatus_CRCLow:
CRCReceived = c;
status = kStatus_CRCHigh;
break;
case kStatus_CRCHigh:
CRCReceived |= (c<<8);
RxPkt->ofs = 0;
CRCCalculated = 0;
status = kStatus_Data;
break;
case kStatus_Data:
RxPkt->buf[RxPkt->ofs++] = c;
if(RxPkt->type == 0xA7 && RxPkt->ofs >= 8)
{
RxPkt->payload_len = 8;
event_handler(RxPkt);
status = kStatus_Idle;
}
if(RxPkt->ofs >= MAX_PACKET_LEN)
{
status = kStatus_Idle;
return CH_ERR;
}
if(RxPkt->ofs >= RxPkt->payload_len && RxPkt->type == 0xA5)
{
/* calculate CRC */
crc16_update(&CRCCalculated, crc_header, 4);
crc16_update(&CRCCalculated, RxPkt->buf, RxPkt->ofs);
/* CRC match */
if(CRCCalculated == CRCReceived)
{
frame_count++;
event_handler(RxPkt);
}
status = kStatus_Idle;
}
break;
default:
status = kStatus_Idle;
break;
}
return CH_OK;
}
| [
"b04611002@ntu.edu.tw"
] | b04611002@ntu.edu.tw |
a05e4315fd8e17620215e76349bbaa4eeef82231 | 8e9a465820b8d17e794890ab9dba66d783a1668d | /source/cv/calibration/ChessboardFinder.cpp | a4ba11c4ba530fe94c3633bc3a2f79776cfe45b5 | [
"BSD-3-Clause"
] | permissive | spsu/image-research | 57b722991f46631adee182040c8f432f7d60e6c1 | ad9548bc360d367879f8bc377c9d14f164466678 | refs/heads/master | 2020-11-26T20:55:59.567286 | 2010-08-10T03:15:23 | 2010-08-10T03:15:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,123 | cpp | /**
* Copyright (c) 2010 Brandon Thomas Suit
* http://possibilistic.org | echelon@gmail.com
* Code available for use under the LGPL 2.
*
* Cv::Calibration::ChessboardFinder
* An easy mechanism for finding and recording chessboard corners in an
* image.
*/
#include "ChessboardFinder.hpp"
#include "ChessboardCorners.hpp"
#include "../Image.hpp"
namespace Cv {
namespace Calibration {
ChessboardFinder::ChessboardFinder(CvSize sz):
boardSize(sz),
boardArea(sz.width*sz.height),
objectPoints(0),
imagePoints(0),
pointCounts(0),
matricesDirty(true),
tempGray(0)
{
// nothing yet
}
ChessboardFinder::ChessboardFinder(int width, int height):
boardSize(cvSize(width, height)),
boardArea(width*height),
objectPoints(0),
imagePoints(0),
pointCounts(0),
matricesDirty(true),
tempGray(0)
{
// nothing yet
}
ChessboardFinder::~ChessboardFinder()
{
while(!allCorners.empty()) {
delete allCorners.back();
allCorners.pop_back();
}
// TODO: One if stmt
if(objectPoints != NULL) {
cvReleaseMat(&objectPoints);
}
if(imagePoints != NULL) {
cvReleaseMat(&imagePoints);
}
if(pointCounts != NULL) {
cvReleaseMat(&pointCounts);
}
if(tempGray != NULL) {
cvReleaseImage(&tempGray);
}
}
/*bool ChessboardFinder::findSaveCorners(Cv::Image* img, int flags)
{
//int cornerTotal = 0;
CvPoint2D32f* corners = 0;
int f = 0;
int count = 0;
corners = new CvPoint2D32f[boardArea];
f = cvFindChessboardCorners(
img->getPtr(), boardSize,
corners, &count,
flags
);
if(f == 0 || count < boardArea) {
delete corners;
return false;
}
// Only do once per instance!
if(tempGray == NULL) {
tempGray = cvCreateImage(img->getSize(), 8, 1);
}
cvCvtColor(img->getPtr(), tempGray, CV_BGR2GRAY);
// Subpixel accuracy must be interpolated
cvFindCornerSubPix(
tempGray, corners, count,
cvSize(11, 11), cvSize(-1, -1),
cvTermCriteria(
CV_TERMCRIT_ITER + CV_TERMCRIT_EPS,
30, 0.01
)
);
allCorners.push_back(corners);
matricesDirty = true;
return true;
}*/
ChessboardCorners* ChessboardFinder::findCorners(Cv::Image* img, int flags)
{
//int cornerTotal = 0;
ChessboardCorners* corners = 0;
int f = 0;
int count = 0;
corners = new ChessboardCorners(boardSize);
f = cvFindChessboardCorners(
img->getPtr(), boardSize,
corners->corners, &corners->numFound,
flags
);
if(f == 0 || count < boardArea) {
//delete corners;
//return false;
return corners;
}
// Only do once per instance!
if(tempGray == NULL) {
tempGray = cvCreateImage(img->getSize(), 8, 1);
}
cvCvtColor(img->getPtr(), tempGray, CV_BGR2GRAY);
// Subpixel accuracy must be interpolated
cvFindCornerSubPix(
tempGray, corners->corners, corners->numFound,
cvSize(11, 11), cvSize(-1, -1),
cvTermCriteria(
CV_TERMCRIT_ITER + CV_TERMCRIT_EPS,
30, 0.01
)
);
//allCorners.push_back(corners);
//matricesDirty = true;
return corners;
}
void ChessboardFinder::saveCorners(ChessboardCorners* corners)
{
allCorners.push_back(corners);
}
int ChessboardFinder::numFound()
{
return allCorners.size();
}
CvMat* ChessboardFinder::getObjectPoints()
{
if(matricesDirty) {
generateMatrices();
}
return objectPoints;
}
CvMat* ChessboardFinder::getImagePoints()
{
if(matricesDirty) {
generateMatrices();
}
return imagePoints;
}
CvMat* ChessboardFinder::getPointCounts()
{
if(matricesDirty) {
generateMatrices();
}
return pointCounts;
}
void ChessboardFinder::generateMatrices()
{
int found = 0;
int len = 0;
if(!matricesDirty) {
return; // No need...
}
found = numFound();
if(found == 0) {
fprintf(stderr, "No chessboards found, cannot generate matrices.\n");
return;
}
// =============
// Object Points
// =============
if(objectPoints != NULL) {
cvReleaseMat(&objectPoints);
}
len = found * boardArea;
// TODO: This is all wrong...
objectPoints = cvCreateMat(found, 3, CV_64F); // TODO: CV_32FC1 ?
if(imagePoints != NULL) {
cvReleaseMat(&imagePoints);
}
imagePoints = cvCreateMat(found*boardArea, 2, CV_64F); // TODO: CV_32FC1 ?
// Code adapted from [Bradski, Kaehler]
for(unsigned int i = 0; i < allCorners.size(); i++) {
for(int j = 0; j < boardArea; j++) {
int step = i * boardArea + j;
CV_MAT_ELEM(*imagePoints, float, step, 0) =
allCorners[i]->corners[j].x;
CV_MAT_ELEM(*imagePoints, float, step, 1) =
allCorners[i]->corners[j].y;
CV_MAT_ELEM(*objectPoints, float, step, 0) = j/boardSize.width;
CV_MAT_ELEM(*objectPoints, float, step, 1) = j%boardSize.width;
CV_MAT_ELEM(*objectPoints, float, step, 2) = 0.0f;
}
}
//for(int i = 0; i < boardSize.width; i++) {
// for(int i = 0; i < boardSize.height; i++) {
// CV_MAT_ELEM(*objectPoints, float, i, j) = i;
// }
//}
// TODO... how??
// ============
// Point Counts
// ============
if(pointCounts != NULL) {
cvReleaseMat(&pointCounts);
}
pointCounts = cvCreateMat(found, 1, CV_64F);
for(int i = 0; i < found; i++) {
CV_MAT_ELEM(*pointCounts, int, i, 0) = boardArea;
}
matricesDirty = false;
}
} // end namespace Calibration
} // end namespace Cv
| [
"brandon.suit@gmail.com"
] | brandon.suit@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.