Example #1
0
void PopupMenu::_set_items(const Array &p_items) {

	ERR_FAIL_COND(p_items.size() % 10);
	clear();

	for (int i = 0; i < p_items.size(); i += 10) {

		String text = p_items[i + 0];
		Ref<Texture> icon = p_items[i + 1];
		bool checkable = p_items[i + 2];
		bool checked = p_items[i + 3];
		bool disabled = p_items[i + 4];

		int id = p_items[i + 5];
		int accel = p_items[i + 6];
		Variant meta = p_items[i + 7];
		String subm = p_items[i + 8];
		bool sep = p_items[i + 9];

		int idx = get_item_count();
		add_item(text, id);
		set_item_icon(idx, icon);
		set_item_as_checkable(idx, checkable);
		set_item_checked(idx, checked);
		set_item_disabled(idx, disabled);
		set_item_id(idx, id);
		set_item_metadata(idx, meta);
		set_item_as_separator(idx, sep);
		set_item_accelerator(idx, accel);
		set_item_submenu(idx, subm);
	}
}
Example #2
0
Digraph< int > createTinyDigraph( void )
{
	Array< int > edges = {
		0, 1,
		0, 5,
		0, 6,
		2, 0,
		2, 3,
		3, 5,
		5, 4,
		6, 4,
		6, 9,
		7, 6,
		8, 7,
		9, 10,
		9, 11,
		9, 12,
		11, 12,
	};

	Digraph< int > d;
	for ( int i = 0; i < edges.size() / 2; i++ ) {
		d.addEdge( edges[ i * 2 ], edges[ i * 2 + 1 ] );
	}

	return d;
}
Example #3
0
Value getrawtransaction(const Array& params, bool fHelp)
{
    if (fHelp || params.size() < 1 || params.size() > 2)
        throw runtime_error(
            "getrawtransaction <txid> [verbose=0]\n"
            "If verbose=0, returns a string that is\n"
            "serialized, hex-encoded data for <txid>.\n"
            "If verbose is non-zero, returns an Object\n"
            "with information about <txid>.");

    uint256 hash = ParseHashV(params[0], "parameter 1");

    bool fVerbose = false;
    if (params.size() > 1)
        fVerbose = (params[1].get_int() != 0);

    CTransaction tx;
    uint256 hashBlock = 0;
    if (!GetTransaction(hash, tx, hashBlock, true))
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");

    CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
    ssTx << tx;
    string strHex = HexStr(ssTx.begin(), ssTx.end());

    if (!fVerbose)
        return strHex;

    Object result;
    result.push_back(Pair("hex", strHex));
    TxToJSON(tx, hashBlock, result);
    return result;
}
Example #4
0
Array<T>::Array(const Array<T>& parent, const dim4 &dims, const dim4 &offsets, const dim4 &strides) :
    ArrayInfo(parent.getDevId(), dims, offsets, strides, (af_dtype)dtype_traits<T>::af_type),
    data(parent.getData()), data_dims(parent.getDataDims()),
    node(), ready(true),
    offset(parent.getOffset() + calcOffset(parent.strides(), offsets)),
    owner(false)
{ }
Example #5
0
 bool reconfigure(size_t attack_samples, size_t release_samples,
                  sample_t threshold, sample_t smoothness)
 {
     if (attack_samples == 0 ||
         attack_samples > attack_envelope_.capacity()) {
         return false;
     }
     if (release_samples == 0 ||
         release_samples > release_envelope_.capacity()) {
         return false;
     }
     sample_t new_threshold = Value<sample_t>::force_between(threshold,
                                                             0.01, 1);
     sample_t new_smoothness = Value<sample_t>::force_between(smoothness,
                                                              1, 4);
     bool recalculate_attack_envelope =
             attack_samples != attack_samples_ ||
             new_smoothness != smoothness_;
     bool recalculate_release_envelope =
             release_samples != release_samples_ ||
             new_smoothness != smoothness_;
     attack_samples_ = attack_samples;
     release_samples_ = release_samples;
     threshold_ = threshold;
     smoothness_ = smoothness;
     generate_envelopes_reset(recalculate_attack_envelope,
                              recalculate_release_envelope);
     return true;
 }
MoleculeRGroupsComposition::MoleculeRGroupsComposition(BaseMolecule &mol)
: _mol(mol), _rgroups(_mol.rgroups),
  _rsites_count(_mol.countRSites()),
  _rgroups_count(_rgroups.getRGroupCount())
{
   _limits.resize(_rsites_count);
   _rgroup2size.resize(_rgroups_count+1);

   int rsite = 0;
   for (auto vertex : _mol.vertices()) {
      if (!_mol.isRSite(vertex)) { continue; }
      _rsite2vertex.insert(rsite, vertex);

      Array<int> rgroups;
      _mol.getAllowedRGroups(vertex, rgroups);
      _rsite2rgroup.insert(vertex, rgroups);

      int total = 0;
      for (int i = 0; i < rgroups.size(); i++) {
         int rgroup = rgroups[i];
         int size   = _rgroups.getRGroup(rgroup).fragments.size();
         _rgroup2size[rgroup] = size;
         total += size;
      }
      _limits[rsite] = total-1;
      rsite++;
   }
}
Example #7
0
void Json::Copy(const Json& json){
	_kind = json._kind;
	switch(json._kind){
	case kNull: {  _data = NULL; break;}
	case kNumber: {  _data = new double(json.GetDouble()); break; } 
	case kString: {  _data = new std::string(json.GetString()); break; }
	case kTrue: case kFalse: { _data = new bool(json.GetBool());break;  }
	case kArray: 
		{
			Array * thisArr = new Array;
			Array& arr = *(Array*)json._data;
			for(Array::iterator it = arr.begin(); it != arr.end(); it++){
				thisArr->push_back(new Json(*(*it)) );
			}
			_data = thisArr;
			break;
		}
	case kObject: 
		{
			Object* thisObj = new Object;
			Object& obj = *(Object*)json._data;
			for(Object::iterator it = obj.begin(); it != obj.end(); it++){
				Pair p;
				p.first = it->first; 
				p.second = new Json(*(it->second));
				thisObj->insert(p);
			}
			_data = thisObj;
			break;
		}
	default: break;
	}
}
Example #8
0
void ExtendedLogger::PrintStackTrace(FILE *f, const Array& stackTrace,
                                     bool escape /* = false */,
                                     bool escapeMore /* = false */) {
  int i = 0;
  for (ArrayIter it(stackTrace); it; ++it, ++i) {
    if (i > 0) {
      fprintf(f, "%s", escape ? "\\n" : "\n");
    }
    Array frame = it.second().toArray();
    fprintf(f, "    #%d ", i);
    if (frame.exists(s_function)) {
      if (frame.exists(s_class)) {
        fprintf(f, "%s%s%s(), called ", frame[s_class].toString().c_str(),
                frame[s_type].toString().c_str(),
                frame[s_function].toString().c_str());
      } else {
        fprintf(f, "%s(), called ", frame[s_function].toString().c_str());
      }
    }
    fprintf(f, "at [%s:%" PRId64 "]", frame[s_file].toString().c_str(),
            frame[s_line].toInt64());
  }
  fprintf(f, escapeMore ? "\\n" : "\n");
  fflush(f);
}
Example #9
0
void SpriteFrames::_set_animations(const Array &p_animations) {

	animations.clear();
	for (int i = 0; i < p_animations.size(); i++) {

		Dictionary d = p_animations[i];

		ERR_CONTINUE(!d.has("name"));
		ERR_CONTINUE(!d.has("speed"));
		ERR_CONTINUE(!d.has("loop"));
		ERR_CONTINUE(!d.has("frames"));

		Anim anim;
		anim.speed = d["speed"];
		anim.loop = d["loop"];
		Array frames = d["frames"];
		for (int j = 0; j < frames.size(); j++) {

			RES res = frames[j];
			anim.frames.push_back(res);
		}

		animations[d["name"]] = anim;
	}
}
Example #10
0
String f_system(const String& command, VRefParam return_var /* = null */) {
  ShellExecContext ctx;
  FILE *fp = ctx.exec(command.c_str());
  if (!fp) return empty_string();
  StringBuffer sbuf;
  if (fp) {
    sbuf.read(fp);
  }

  Array lines = StringUtil::Explode(sbuf.detach(), "\n").toArray();
  int ret = ctx.exit();
  if (WIFEXITED(ret)) ret = WEXITSTATUS(ret);
  return_var = ret;
  int count = lines.size();
  if (count > 0 && lines[count - 1].toString().empty()) {
    count--; // remove explode()'s last empty line
  }

  auto& ectx = *g_context;
  for (int i = 0; i < count; i++) {
    ectx.write(lines[i].toString());
    ectx.write("\n");
  }
  if (!count || lines.empty()) {
    return String();
  }

  return f_rtrim(lines[count - 1].toString());
}
Example #11
0
void assign(Array<T>& out, const af_index_t idxrs[], const Array<T>& rhs)
{
    out.eval();
    rhs.eval();

    vector<bool> isSeq(4);
    vector<af_seq> seqs(4, af_span);
    // create seq vector to retrieve output dimensions, offsets & offsets
    for (dim_t x=0; x<4; ++x) {
        if (idxrs[x].isSeq) {
            seqs[x] = idxrs[x].idx.seq;
        }
        isSeq[x] = idxrs[x].isSeq;
    }

    vector< Array<uint> > idxArrs(4, createEmptyArray<uint>(dim4()));
    // look through indexs to read af_array indexs
    for (dim_t x=0; x<4; ++x) {
        if (!isSeq[x]) {
            idxArrs[x] = castArray<uint>(idxrs[x].idx.arr);
            idxArrs[x].eval();
        }
    }

    vector<CParam<uint>> idxParams(idxArrs.begin(), idxArrs.end());
    getQueue().enqueue(kernel::assign<T>, out, out.getDataDims(), rhs,
                       move(isSeq), move(seqs), move(idxParams));
}
Example #12
0
String f_exec(const String& command, VRefParam output /* = null */,
              VRefParam return_var /* = null */) {
  ShellExecContext ctx;
  FILE *fp = ctx.exec(command.c_str());
  if (!fp) return empty_string();
  StringBuffer sbuf;
  sbuf.read(fp);

  Array lines = StringUtil::Explode(sbuf.detach(), "\n").toArray();
  int ret = ctx.exit();
  if (WIFEXITED(ret)) ret = WEXITSTATUS(ret);
  return_var = ret;
  int count = lines.size();
  if (count > 0 && lines[count - 1].toString().empty()) {
    count--; // remove explode()'s last empty line
  }

  PackedArrayInit pai(count);
  for (int i = 0; i < count; i++) {
    pai.append(lines[i]);
  }
  output.wrapped() = pai.toArray();

  if (!count || lines.empty()) {
    return String();
  }

  return f_rtrim(lines[count - 1].toString());
}
void dumpArray(std::ostream& file, const Array<T> table,
        const std::string& title = "", int indent = 0) {
    std::string indentString(indent, ' ');
    if (!title.empty()) {
        file << indentString << title << std::endl;
    }
    Array<std::string> txts(table.width(), table.height());
    size_t maxlen = 0;
    for (Point  p: arrayRange(table)) {
        txts[p] = boost::lexical_cast<std::string>(table[p]);
        maxlen = std::max(maxlen, txts[p].size());
    }
    // leave a space between characters
    ++maxlen;
    Point p;
    for (p.y = 0; p.y < static_cast<int>(table.height()); p.y++) {
        file << indentString;
        for (p.x = 0; p.x < static_cast<int>(table.width()); p.x++) {
            file.width(maxlen);
            file << txts[p];
        }
        file << std::endl;
    }
    file << std::endl;
}
Example #14
0
Array* Scale(Array* points, int resolution, float threshold)
{
    Array* scaled = Array::create();
    
    Rect bb = BoundingBox(points);
    
    bool is1D = MIN(bb.size.width / bb.size.height, bb.size.height / bb.size.width) <= threshold;
    
    for (int i = 0; i < points->count(); i++) {
        PointObject* p = (PointObject*)points->getObjectAtIndex(i);
        float qx;
        float qy;
        float scale;
        
        if (is1D) {
            scale = (resolution / MAX(bb.size.width, bb.size.height));
            qx = p->x * scale;
            qy = p->y * scale;
        } else {
            qx = p->x * (resolution / bb.size.width);
            qy = p->y * (resolution / bb.size.height);
        }
        scaled->addObject(PointObject::create(qx, qy));
    }
    
    return scaled;
}
Example #15
0
Value setgenerate(const Array& params, bool fHelp)
{
    if (fHelp || params.size() < 1 || params.size() > 2)
        throw runtime_error(
            "setgenerate <generate> [genproclimit]\n"
            "<generate> is true or false to turn generation on or off.\n"
            "Generation is limited to [genproclimit] processors, -1 is unlimited.");

    bool fGenerate = true;
    if (params.size() > 0)
        fGenerate = params[0].get_bool();

    if (params.size() > 1)
    {
        int nGenProcLimit = params[1].get_int();
        mapArgs["-genproclimit"] = itostr(nGenProcLimit);
        if (nGenProcLimit == 0)
            fGenerate = false;
    }
    mapArgs["-gen"] = (fGenerate ? "1" : "0");

    assert(pwalletMain != NULL);
    GenerateBitcoins(fGenerate, pwalletMain);
    return Value::null;
}
Example #16
0
	std::vector<std::shared_ptr<Administrator>>  Departement::administrators(IDataManager &oMan, int skip /*= 0*/, int count /*= 10*/) {
		std::vector<std::shared_ptr<Administrator>> oRet;
		if (this->has_id()) {
			Person oPers;
			Enseignant model(*this, oPers);
			std::string start = model.start_key();
			std::string end = model.end_key();
			Value vr = oMan.read_docs_range(start, end, skip, count);
			if (vr.is_array()) {
				Array *pAr = vr.as_array();
				if (pAr != nullptr) {
					size_t n = pAr->size();
					for (size_t i = 0; i < n; ++i) {
						PValue ov = (*pAr)[i];
						Value *pv = ov.get();
						if (pv != nullptr) {
							std::shared_ptr<Administrator> d = std::make_shared<Administrator>(*pv);
							oRet.push_back(d);
						}
					}// i
				}// pAr
			}// array
		}// has_id
		return oRet;
	}
MoleculeIter::SourceRGroups::SourceRGroups(const MoleculeIter &m) {
   Array<int> fs;
   m._at.dump(fs);
   MultiMap<int, int> rgroup2fragment;
   RedBlackMap<Fragment, int> fragment2count;
   for (auto i = 0; i < fs.size(); i++) {
      auto x = m._parent._fragment_coordinates(i, fs[i]);
      if (rgroup2fragment.find(x.rgroup, x.fragment)) {
         int count = fragment2count.at(x);
         fragment2count.remove(x);
         fragment2count.insert(x, count + 1);
      } else {
         rgroup2fragment.insert(x.rgroup, x.fragment);
         fragment2count.insert(x, 1);
      }
   }

   const RedBlackSet<int> &rgroups = rgroup2fragment.keys();
   for (auto i = rgroups.begin(); i != rgroups.end(); i = rgroups.next(i)) {
      auto r = rgroups.key(i);
      RGroup &rgroup = _rgroups.push();
      RGroup &source = m._parent._rgroups.getRGroup(r);

      const RedBlackSet<int> &fs_r = rgroup2fragment[r];
      for (auto j = fs_r.begin(); j != fs_r.end(); j = fs_r.next(j)) {
         auto f = fs_r.key(j);
         for (auto k = 0; k < fragment2count.at({r,f}); k++) {
            Molecule *fragment = new Molecule();
            fragment->clone(*source.fragments[f], nullptr, nullptr);
            fragment->removeAttachmentPoints();
            rgroup.fragments.add(fragment);
         }
      }
   }
}
Example #18
0
int main()
{
	Array array;
	array.ArrayInsert(1);
	array.ArrayOut(100);
	return 0;
}
Example #19
0
void OStringStream::get( string* a ) const {
	if ( mImpl->size() > 0 ){
		Array< char > t;
		mImpl->get( &t );
		*a = string( &t[ 0 ], t.size() - 1 ); //ArraySizeはNULL終端分多いので引いてやる
	}
}
Example #20
0
Boolean ComputerSystem::getOperationalStatus(CIMProperty& p)
{
  Array<Uint16> opStatus;
  opStatus.append(2); // OK
  p = CIMProperty(PROPERTY_OPERATIONAL_STATUS, opStatus);
  return true;
}
Example #21
0
Array<T> createSubArray(const Array<T>& parent,
                        const std::vector<af_seq> &index,
                        bool copy)
{
    parent.eval();

    dim4 dDims = parent.getDataDims();
    dim4 pDims = parent.dims();

    dim4 dims   = toDims  (index, pDims);
    dim4 offset = toOffset(index, dDims);
    dim4 stride = toStride (index, dDims);

    Array<T> out = Array<T>(parent, dims, offset, stride);

    if (!copy) return out;

    if (stride[0] != 1 ||
            stride[1] <  0 ||
            stride[2] <  0 ||
            stride[3] <  0) {

        out = copyArray(out);
    }

    return out;
}
Example #22
0
void load( const char* filename ){
	gAnimationIndex = 0;
	gModels.clear(); //モデルがあれば破棄
	gTrees.clear(); //ツリーがあれば破棄
	gContainer = Container::create( filename ); //ロードしなおし
	while ( !gContainer.isReady() ){ //ロード待ち
		;
	}

	int n = gContainer.treeNumber();
	gTrees.setSize( n );
	for ( int i = 0; i < n; ++i ){
		gTrees[ i ] = gContainer.createTree( i );
		if ( gContainer.animationNumber() > 0 ){
			gTrees[ i ].setAnimation( gContainer.animation( 0 ) );
		}
	}
	if ( n == 0 ){ //ツリーがあればモデルは出さない
		n = gContainer.batchNumber();
		gModels.setSize( n );
		for ( int i = 0; i < n; ++i ){
			gModels[ i ] = gContainer.createModel( i );
		}
	}
}
Example #23
0
void fourier_base(const Array<COMPLEX,1> &in, Array<COMPLEX,1> &out, bool direct) {
 
  // !!!! L must always be the number of time bins !!!!
  const int L( (direct ? in.extent(0) : out.extent(0)) );
  //const int L(max(in.extent(0),out.extent(0)));  <-- bug

  fftw_complex *inFFT, *outFFT;
  fftw_plan p;
  inFFT = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * L);
  outFFT = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * L);

  const COMPLEX * restrict in_ptr = in.dataFirst();
  COMPLEX * restrict out_ptr = out.dataFirst();
  const int imax(min(L,in.extent(0)));
  for (int i =0; i<imax; ++i) { inFFT[i][0] = real(in_ptr[i]); inFFT[i][1] = imag(in_ptr[i]);}
  for (int i =imax; i<L; ++i) { inFFT[i][0] = 0; inFFT[i][1] = 0;}

  p = fftw_plan_dft_1d(L, inFFT, outFFT, (direct ? FFTW_BACKWARD : FFTW_FORWARD), FFTW_ESTIMATE);
  fftw_execute(p); 

  const int jmax(min(L,out.extent(0)));
  for (int j =0; j<jmax; ++j)  {out_ptr[j] = COMPLEX(outFFT[j][0] ,outFFT[j][1]);}

  fftw_destroy_plan(p); 
  fftw_free(inFFT); fftw_free(outFFT);
}
Example #24
0
Value getblock(const Array& params, bool fHelp)
{
    if (fHelp || params.size() < 1 || params.size() > 2)
        throw runtime_error(
            "getblock <hash> [verbose=true]\n"
            "If verbose is false, returns a string that is serialized, hex-encoded data for block <hash>.\n"
            "If verbose is true, returns an Object with information about block <hash>."
        );

    std::string strHash = params[0].get_str();
    uint256 hash(strHash);

    bool fVerbose = true;
    if (params.size() > 1)
        fVerbose = params[1].get_bool();

    if (mapBlockIndex.count(hash) == 0)
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");

    CBlock block;
    CBlockIndex* pblockindex = mapBlockIndex[hash];
    block.ReadFromDisk(pblockindex);

    if (!fVerbose)
    {
        CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
        ssBlock << block;
        std::string strHex = HexStr(ssBlock.begin(), ssBlock.end());
        return strHex;
    }

    return blockToJSON(block, pblockindex);
}
Example #25
0
void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeHex)
{
    txnouttype type;
    vector<CTxDestination> addresses;
    int nRequired;

    out.push_back(Pair("asm", scriptPubKey.ToString()));

    if (fIncludeHex)
        out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())));

    if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired))
    {
        out.push_back(Pair("type", GetTxnOutputType(TX_NONSTANDARD)));
        return;
    }

    out.push_back(Pair("reqSigs", nRequired));
    out.push_back(Pair("type", GetTxnOutputType(type)));

    Array a;
    BOOST_FOREACH(const CTxDestination& addr, addresses)
        a.push_back(CspincoinAddress(addr).ToString());
    out.push_back(Pair("addresses", a));
}
Example #26
0
Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex)
{
    Object result;
    result.push_back(Pair("hash", block.GetHash().GetHex()));
    CMerkleTx txGen(block.vtx[0]);
    txGen.SetMerkleBranch(&block);
    result.push_back(Pair("confirmations", (int)txGen.GetDepthInMainChain()));
    result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)));
    result.push_back(Pair("height", blockindex->nHeight));
    result.push_back(Pair("version", block.nVersion));
    result.push_back(Pair("merkleroot", block.hashMerkleRoot.GetHex()));
    Array txs;
    BOOST_FOREACH(const CTransaction&tx, block.vtx)
        txs.push_back(tx.GetHash().GetHex());
    result.push_back(Pair("tx", txs));
    result.push_back(Pair("time", (boost::int64_t)block.GetBlockTime()));
    result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce));
    result.push_back(Pair("bits", HexBits(block.nBits)));
    result.push_back(Pair("difficulty", GetDifficulty(blockindex)));

    if (blockindex->pprev)
        result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
    if (blockindex->pnext)
        result.push_back(Pair("nextblockhash", blockindex->pnext->GetBlockHash().GetHex()));
    return result;
}
Example #27
0
  void VM::initialize_config() {
#ifdef USE_DYNAMIC_INTERPRETER
    if(shared.config.dynamic_interpreter_enabled) {
      G(rubinius)->set_const(this, "INTERPRETER", symbol("dynamic"));
    } else {
      G(rubinius)->set_const(this, "INTERPRETER", symbol("static"));
    }
#else
    G(rubinius)->set_const(this, "INTERPRETER", symbol("static"));
#endif

#ifdef ENABLE_LLVM
    if(!shared.config.jit_disabled) {
      Array* ary = Array::create(this, 3);
      ary->append(this, symbol("usage"));
      if(shared.config.jit_inline_generic) {
        ary->append(this, symbol("inline_generic"));
      }

      if(shared.config.jit_inline_blocks) {
        ary->append(this, symbol("inline_blocks"));
      }
      G(rubinius)->set_const(this, "JIT", ary);
    } else {
      G(rubinius)->set_const(this, "JIT", Qfalse);
    }
#else
    G(rubinius)->set_const(this, "JIT", Qnil);
#endif
  }
ListUniqueProblemsResult& ListUniqueProblemsResult::operator =(const AmazonWebServiceResult<JsonValue>& result)
{
  const JsonValue& jsonValue = result.GetPayload();
  if(jsonValue.ValueExists("uniqueProblems"))
  {
    Aws::Map<Aws::String, JsonValue> uniqueProblemsJsonMap = jsonValue.GetObject("uniqueProblems").GetAllObjects();
    for(auto& uniqueProblemsItem : uniqueProblemsJsonMap)
    {
      Array<JsonValue> uniqueProblemsJsonList = uniqueProblemsItem.second.AsArray();
      Aws::Vector<UniqueProblem> uniqueProblemsList((size_t)uniqueProblemsJsonList.GetLength());
      for(unsigned uniqueProblemsIndex = 0; uniqueProblemsIndex < uniqueProblemsJsonList.GetLength(); ++uniqueProblemsIndex)
      {
        uniqueProblemsList.push_back(uniqueProblemsJsonList[uniqueProblemsIndex].AsObject());
      }
      m_uniqueProblems[ExecutionResultMapper::GetExecutionResultForName(uniqueProblemsItem.first)] = std::move(uniqueProblemsList);
    }
  }

  if(jsonValue.ValueExists("nextToken"))
  {
    m_nextToken = jsonValue.GetString("nextToken");

  }



  return *this;
}
Example #29
0
Value listunspent(const Array& params, bool fHelp)
{
    if (fHelp || params.size() > 3)
        throw runtime_error(
            "listunspent [minconf=1] [maxconf=9999999]  [\"address\",...]\n"
            "Returns array of unspent transaction outputs\n"
            "with between minconf and maxconf (inclusive) confirmations.\n"
            "Optionally filtered to only include txouts paid to specified addresses.\n"
            "Results are an array of Objects, each of which has:\n"
            "{txid, vout, scriptPubKey, amount, confirmations}");

    RPCTypeCheck(params, list_of(int_type)(int_type)(array_type));

    int nMinDepth = 1;
    if (params.size() > 0)
        nMinDepth = params[0].get_int();

    int nMaxDepth = 9999999;
    if (params.size() > 1)
        nMaxDepth = params[1].get_int();

    set<CBitcoinAddress> setAddress;
    if (params.size() > 2)
    {
        Array inputs = params[2].get_array();
        BOOST_FOREACH(Value& input, inputs)
        {
            CBitcoinAddress address(input.get_str());
            if (!address.IsValid())
                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Guldencoin address: ")+input.get_str());
            if (setAddress.count(address))
                throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
           setAddress.insert(address);
        }
Example #30
0
void AssetData_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("id"));
	outFields->push(HX_CSTRING("path"));
	outFields->push(HX_CSTRING("type"));
	super::__GetFields(outFields);
};