二期c++接口

Dependencies:   EthernetInterface mbed-rtos mbed uniqueCPUID

Fork of bcsdk by Heng Well

Committer:
MrAI
Date:
Fri Jun 08 01:40:23 2018 +0000
Revision:
17:82d09b5a9189
Parent:
15:7b56d49392be
????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
webmaster 8:f2a567ee3a46 1 /***********************************************************************
webmaster 8:f2a567ee3a46 2 * Module: Account.h
webmaster 8:f2a567ee3a46 3 * Author: Administrator
webmaster 8:f2a567ee3a46 4 * Modified: 2017Äê8ÔÂ18ÈÕ 11:06:20
webmaster 8:f2a567ee3a46 5 * Purpose: Declaration of the class Account
webmaster 8:f2a567ee3a46 6 * Comment: ÕË»§
webmaster 8:f2a567ee3a46 7 ***********************************************************************/
webmaster 8:f2a567ee3a46 8
webmaster 8:f2a567ee3a46 9 #if !defined(__Account_Account_h)
webmaster 8:f2a567ee3a46 10 #define __Account_Account_h
webmaster 10:aabd720e632c 11 #include <string>
webmaster 10:aabd720e632c 12 #include <map>
webmaster 10:aabd720e632c 13 #include "Key.h"
webmaster 10:aabd720e632c 14 #include "Object.h"
MrAI 12:1b24ea479a59 15 #include "MbedJSONValue.h"
webmaster 10:aabd720e632c 16 using namespace std;
webmaster 8:f2a567ee3a46 17
webmaster 8:f2a567ee3a46 18 class Account
webmaster 8:f2a567ee3a46 19 {
webmaster 8:f2a567ee3a46 20 public:
webmaster 10:aabd720e632c 21 Account();
webmaster 10:aabd720e632c 22 Account(Key &key);
webmaster 10:aabd720e632c 23 ~Account();
webmaster 10:aabd720e632c 24
webmaster 10:aabd720e632c 25 std::string id;
webmaster 10:aabd720e632c 26 std::string alias;
webmaster 10:aabd720e632c 27 //Key* keys;
webmaster 10:aabd720e632c 28 int quorum;
webmaster 10:aabd720e632c 29 map<std::string,Object> tags;
webmaster 10:aabd720e632c 30
webmaster 10:aabd720e632c 31 void setId(const string newId){this->id = newId;};
webmaster 10:aabd720e632c 32 string getId(){return this->id;};
webmaster 10:aabd720e632c 33
webmaster 10:aabd720e632c 34 void setAlias(const string newAlias){this->alias = newAlias;};
webmaster 10:aabd720e632c 35 string getAlias(){return this->alias;};
webmaster 10:aabd720e632c 36
webmaster 10:aabd720e632c 37 void setQuorum(int newQuorum){this->quorum = newQuorum;};
webmaster 10:aabd720e632c 38 int getQuorum(){return this->quorum;};
webmaster 10:aabd720e632c 39
MrAI 15:7b56d49392be 40 string getBalance(MbedJSONValue &in_out,string strWallet);
MrAI 15:7b56d49392be 41 string getWallet(MbedJSONValue &in_out);
MrAI 12:1b24ea479a59 42
webmaster 10:aabd720e632c 43 string createAccount();
webmaster 10:aabd720e632c 44 string listAccounts();
MrAI 12:1b24ea479a59 45 string getParseMbedJson(MbedJSONValue& out, const char * pos);//ת»»³ÉMbedjson¸ñʽ
MrAI 12:1b24ea479a59 46 bool getRequestRet(MbedJSONValue& in);//»ñÈ¡½»Ò׳ɹ¦±êÖ¾
MrAI 12:1b24ea479a59 47 string getKeyValue(MbedJSONValue& in, string Key1, string Key2);//»ñÈ¡¼üÖµ
MrAI 12:1b24ea479a59 48 string getKeyValue(MbedJSONValue& in, string Key1);
MrAI 12:1b24ea479a59 49 bool getKeyValueBool(MbedJSONValue& in, string Key1, string Key2);
MrAI 12:1b24ea479a59 50 bool getKeyValueBool(MbedJSONValue& in, string Key1);
MrAI 12:1b24ea479a59 51 int getKeyValueInt(MbedJSONValue& in, string Key1, string Key2);
MrAI 12:1b24ea479a59 52 double getKeyValuedouble(MbedJSONValue& in, string Key1, string Key2);
MrAI 12:1b24ea479a59 53 int getLedger(MbedJSONValue& in);//»ñÈ¡Ledger³¤¶È
MrAI 12:1b24ea479a59 54 int getBalanceSize(MbedJSONValue& in,string Key1);//»ñÈ¡Óà¶î¶ÔÏóÊý×é´óС
MrAI 12:1b24ea479a59 55 int getBalanceSize(MbedJSONValue& in, string Key1,string Key2);
MrAI 15:7b56d49392be 56 int getBalanceSizeEx(MbedJSONValue& in, string Key1, string Key2, int i);
MrAI 12:1b24ea479a59 57 string getBalanceArray(MbedJSONValue& in, string Key1, int i, string Key2);//»ñÈ¡Óà¶îÊý¾Ý
MrAI 12:1b24ea479a59 58 string getBalanceArray(MbedJSONValue& in, string Key1, string Key2, int i, string Key3);
MrAI 12:1b24ea479a59 59 string getBalanceArray(MbedJSONValue& in, string Key1, string Key2, string Key3, int i, string Key4);
MrAI 15:7b56d49392be 60 string getBalanceArrayEx(MbedJSONValue& in, string Key1, string Key2, int i, string Key3);
MrAI 15:7b56d49392be 61 string getBalanceArray_five(MbedJSONValue& in, string Key1, int i, string Key2, int j, string Key3);
webmaster 8:f2a567ee3a46 62 protected:
webmaster 8:f2a567ee3a46 63 private:
webmaster 10:aabd720e632c 64 Client client;
webmaster 10:aabd720e632c 65 MbedJSONValue m_valTags;
webmaster 10:aabd720e632c 66 Key m_Keys;
webmaster 8:f2a567ee3a46 67
webmaster 8:f2a567ee3a46 68 };
webmaster 8:f2a567ee3a46 69
MrAI 12:1b24ea479a59 70 #endif