Exemple #1
0
UPTR_T<Transactor> Transactor::makeTransactor (const SerializedTransaction& txn, TransactionEngineParams params, TransactionEngine* engine)
{
    switch (txn.getTxnType ())
    {
    case ttPAYMENT:
        return UPTR_T<Transactor> (new PaymentTransactor (txn, params, engine));

    case ttACCOUNT_SET:
        return UPTR_T<Transactor> (new AccountSetTransactor (txn, params, engine));

    case ttREGULAR_KEY_SET:
        return UPTR_T<Transactor> (new RegularKeySetTransactor (txn, params, engine));

    case ttTRUST_SET:
        return UPTR_T<Transactor> (new TrustSetTransactor (txn, params, engine));

    case ttOFFER_CREATE:
        return UPTR_T<Transactor> (new OfferCreateTransactor (txn, params, engine));

    case ttOFFER_CANCEL:
        return UPTR_T<Transactor> (new OfferCancelTransactor (txn, params, engine));

    case ttWALLET_ADD:
        return UPTR_T<Transactor> (new WalletAddTransactor (txn, params, engine));

    case ttFEATURE:
    case ttFEE:
        return UPTR_T<Transactor> (new ChangeTransactor (txn, params, engine));

    default:
        return UPTR_T<Transactor> ();
    }
}
std::unique_ptr<Transactor> Transactor::makeTransactor (
    SerializedTransaction const& txn,
    TransactionEngineParams params,
    TransactionEngine* engine)
{
    switch (txn.getTxnType ())
    {
    case ttPAYMENT:
        return std::unique_ptr<Transactor> (
            new PaymentTransactor (txn, params, engine));

    case ttGENESIS:
        return std::unique_ptr<Transactor> (
            new GenesisTransactor (txn, params, engine));

    case ttTRANSFER:
        return std::unique_ptr<Transactor> (
            new TransferTransactor (txn, params, engine));

    case ttINFLATION:
		return std::unique_ptr<Transactor>(
			new InflationTransactor(txn, params, engine));

    case ttACCOUNT_SET:
        return std::unique_ptr<Transactor> (
            new AccountSetTransactor (txn, params, engine));

    case ttACCOUNT_MERGE:
        return std::unique_ptr<Transactor>(
            new AccountMergeTransactor (txn, params, engine));

    case ttREGULAR_KEY_SET:
        return std::unique_ptr<Transactor> (
            new RegularKeySetTransactor (txn, params, engine));

    case ttTRUST_SET:
        return std::unique_ptr<Transactor> (
            new TrustSetTransactor (txn, params, engine));

    case ttOFFER_CREATE:
        return make_OfferCreateTransactor (txn, params, engine);

    case ttOFFER_CANCEL:
        return std::unique_ptr<Transactor> (
            new OfferCancelTransactor (txn, params, engine));

    case ttWALLET_ADD:
        return std::unique_ptr<Transactor> (
            new WalletAddTransactor (txn, params, engine));

    case ttAMENDMENT:
    case ttFEE:
        return std::unique_ptr<Transactor> (
            new ChangeTransactor (txn, params, engine));

    default:
        return std::unique_ptr<Transactor> ();
    }
}