本文整理汇总了C++中Tx类的典型用法代码示例。如果您正苦于以下问题:C++ Tx类的具体用法?C++ Tx怎么用?C++ Tx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: checkBDMisReady
bool BlockDataViewer::isTxMainBranch(const Tx &tx) const
{
checkBDMisReady();
if (!tx.hasTxRef())
return false;
return tx.getTxRef().attached(db_).isMainBranch();
}
开发者ID:R0B3RDV,项目名称:BitcoinArmory,代码行数:8,代码来源:BlockDataViewer.cpp
示例2: dbTxRef
bool BlockDataViewer::isTxMainBranch(const Tx &tx) const
{
if (!tx.hasTxRef())
return false;
DBTxRef dbTxRef(tx.getTxRef(), db_);
return dbTxRef.isMainBranch();
}
开发者ID:achow101,项目名称:BitcoinArmory,代码行数:8,代码来源:BlockDataViewer.cpp
示例3: assert
Tx TxRef::getCopy(void) const
{
assert(isInitialized_);
Tx returnTx;
returnTx.unserialize(getPtr());
returnTx.thisHash_ = thisHash_;
returnTx.nBytes_ = nBytes_;
returnTx.headerRefPtr_ = headerPtr_;
return returnTx;
}
开发者ID:Ajaydhyani,项目名称:PyBtcEngine,代码行数:10,代码来源:BlockObjRef.cpp
示例4: apply
void Default::apply(Tx& a_tx)
{
stringstream sstream;
sstream
<< "Tx::evolve_default !!! este estado es inalcanzalbe !!! "
<< endl
<< "estado actual: -"<< a_tx.getState() << "-, evento: -"<< a_tx.getEvent() <<"-."<< endl;
Log::instance().log( sstream.str().c_str() );
a_tx.setEvent( Tx::UNDEFINED );
a_tx.setState( Tx::END );
}
开发者ID:edgarinformaticamodular,项目名称:mtx-transactional-monitor,代码行数:11,代码来源:Default.cpp
示例5: _get_gene_range
Region _get_gene_range(Tx & tx) {
/**
get the lowest and highest positions of a transcripts coding sequence
*/
int boundary_1 = tx.get_cds_start();
int boundary_2 = tx.get_cds_end();
int start = std::min(boundary_1, boundary_2);
int end = std::max(boundary_1, boundary_2);
return Region {start, end};
}
开发者ID:jeremymcrae,项目名称:denovonear,代码行数:13,代码来源:site_rates.cpp
示例6: TxOut
TxOut BlockDataViewer::getPrevTxOut(TxIn & txin) const
{
if (txin.isCoinbase())
return TxOut();
OutPoint op = txin.getOutPoint();
Tx theTx = getTxByHash(op.getTxHash());
if (!theTx.isInitialized())
throw runtime_error("couldn't find prev tx");
uint32_t idx = op.getTxOutIndex();
return theTx.getTxOutCopy(idx);
}
开发者ID:achow101,项目名称:BitcoinArmory,代码行数:13,代码来源:BlockDataViewer.cpp
示例7:
void WT0420RT0430::apply(Tx& a_tx)
{
string id = a_tx.getId();
try
{
Message* currentIn_sp = a_tx.getCurrentIn();
{
QueryManager queryManager;
queryManager.begin();
queryManager.updateTx(
id
,ecc::pp::txs::state::ABORT
,ecc::pp::txs::evolve::PASIVE
);
queryManager.isCommit(true);
}
a_tx.setState( Tx::END );
a_tx.setEvent( Tx::UNDEFINED );
}catch(Exception& e){
e
<< "catch in WT0420RT0430::apply\n"
;
a_tx.setState( Tx::END );
a_tx.setEvent( Tx::EXCEPTION );
throw;
}catch(...){
a_tx.setState( Tx::END );
a_tx.setEvent( Tx::EXCEPTION );
throw;
}
}
开发者ID:edgarinformaticamodular,项目名称:mtx-transactional-monitor,代码行数:31,代码来源:WT0420RT0430.cpp
示例8: destroy_deallocate
inline void destroy_deallocate(const Tx tx, Alloc& alloc, typename AllocTraits::pointer ptr)
{
tx.sometime_synchronized_after([ alloc, ptr = std::move(ptr) ]() mutable noexcept {
AllocTraits::destroy(alloc, detail::to_raw_pointer(ptr));
AllocTraits::deallocate(alloc, std::move(ptr), 1);
});
}
开发者ID:mtak-,项目名称:lockfree-stm,代码行数:7,代码来源:memory.hpp
示例9: allocate
inline Pointer allocate(const Tx tx, Alloc& alloc)
{
Pointer result = AllocTraits::allocate(alloc, 1);
tx.after_fail(
[ alloc, result ]() mutable noexcept { AllocTraits::deallocate(alloc, result, 1); });
return result;
}
开发者ID:mtak-,项目名称:lockfree-stm,代码行数:7,代码来源:memory.hpp
示例10: deallocate
inline void deallocate(const Tx tx,
Alloc& alloc,
typename AllocTraits::pointer ptr,
const std::size_t count)
{
tx.sometime_synchronized_after([ alloc, ptr = std::move(ptr), count ]() mutable noexcept {
AllocTraits::deallocate(alloc, std::move(ptr), count);
});
}
开发者ID:mtak-,项目名称:lockfree-stm,代码行数:9,代码来源:memory.hpp
示例11: allocate_construct
inline Pointer allocate_construct(const Tx tx, Alloc& alloc, Args&&... args)
{
Pointer result = AllocTraits::allocate(alloc, 1);
AllocTraits::construct(alloc, detail::to_raw_pointer(result), (Args &&) args...);
tx.after_fail([ alloc, result ]() mutable noexcept {
AllocTraits::deallocate(alloc, std::move(result), 1);
});
return result;
}
开发者ID:mtak-,项目名称:lockfree-stm,代码行数:9,代码来源:memory.hpp
示例12: _get_mutated_aa
std::string _get_mutated_aa(Tx & tx, std::string base, std::string codon, int intra_codon) {
/**
find the amino acid resulting from a base change to a codon
@tx transcript object for a gene
@base alternate base (e.g. 'G') to introduce
@codon DNA sequence of a single codon
@intra_codon position within the codon to be altered (0-based)
@returns single character amino acid code translated from the altered
codon.
*/
// figure out what the mutated codon is
codon.replace(intra_codon, 1, base);
return tx.translate(codon);
}
开发者ID:jeremymcrae,项目名称:denovonear,代码行数:18,代码来源:site_rates.cpp
示例13: outPointRef
map<BinaryData, map<BinaryData, TxIOPair> >
ZeroConfContainer::ZCisMineBulkFilter(const Tx & tx,
const BinaryData & ZCkey, uint32_t txtime,
function<bool(const BinaryData&)> filter,
bool withSecondOrderMultisig)
{
// Since 99.999%+ of all transactions are not ours, let's do the
// fastest bulk filter possible, even though it will add
// redundant computation to the tx that are ours. In fact,
// we will skip the TxIn/TxOut convenience methods and follow the
// pointers directly to the data we want
/***filter is a pointer to a function that takes in a scrAddr (21 bytes,
including the prefix) and returns a bool. For supernode, it should return
true all the time.
***/
map<BinaryData, map<BinaryData, TxIOPair> > processedTxIO;
BinaryData txHash = tx.getThisHash();
TxRef txref = db_->getTxRef(txHash);
if (txref.isInitialized())
{
//Found this tx in the db. It is already part of a block thus
//is invalid as a ZC
return processedTxIO;
}
uint8_t const * txStartPtr = tx.getPtr();
for (uint32_t iin = 0; iin<tx.getNumTxIn(); iin++)
{
// We have the txin, now check if it contains one of our TxOuts
OutPoint op;
op.unserialize(txStartPtr + tx.getTxInOffset(iin), 36);
//check ZC txhash first, always cheaper than grabing a stxo from DB,
//and will always be checked if the tx doesn't hit in DB outpoints.
{
BinaryData opZcKey;
if (getKeyForTxHash(op.getTxHash(), opZcKey))
{
TxRef outPointRef(opZcKey);
uint16_t outPointId = op.getTxOutIndex();
TxIOPair txio(outPointRef, outPointId,
TxRef(ZCkey), iin);
Tx chainedZC = getTxByHash(op.getTxHash());
const TxOut& chainedTxOut = chainedZC.getTxOutCopy(outPointId);
txio.setTxHashOfOutput(op.getTxHash());
txio.setTxHashOfInput(txHash);
txio.setValue(chainedTxOut.getValue());
txio.setTxTime(txtime);
BinaryData spentSA = chainedTxOut.getScrAddressStr();
auto& key_txioPair = processedTxIO[spentSA];
key_txioPair[txio.getDBKeyOfOutput()] = txio;
auto& wltIdVec = keyToSpentScrAddr_[ZCkey];
wltIdVec.push_back(spentSA);
txOutsSpentByZC_.insert(txio.getDBKeyOfOutput());
continue;
}
}
//fetch the TxOut from DB
BinaryData opKey = op.getDBkey(db_);
if (opKey.getSize() == 8)
{
//found outPoint DBKey, grab the StoredTxOut
StoredTxOut stxOut;
if (db_->getStoredTxOut(stxOut, opKey))
{
BinaryData sa = stxOut.getScrAddress();
if (filter(sa))
{
TxIOPair txio(TxRef(opKey.getSliceRef(0, 6)), op.getTxOutIndex(),
TxRef(ZCkey), iin);
txio.setTxHashOfOutput(op.getTxHash());
txio.setTxHashOfInput(txHash);
txio.setValue(stxOut.getValue());
txio.setTxTime(txtime);
auto& key_txioPair = processedTxIO[sa];
key_txioPair[opKey] = txio;
auto& wltIdVec = keyToSpentScrAddr_[ZCkey];
wltIdVec.push_back(sa);
txOutsSpentByZC_.insert(opKey);
}
}
}
}
//.........这里部分代码省略.........
开发者ID:Bitcoinsulting,项目名称:BitcoinArmorydev,代码行数:101,代码来源:BDM_supportClasses.cpp
示例14: cach
void InitialRT0420::apply(Tx& a_tx)
{
a_tx.timedWait();//parra quitar el primer counter del semaforo
try
{
bool result;
Message* message_p = a_tx.getCurrentIn();
string authorisationCode = message_p->getAuthorisationCode();
string responseCode = message_p->getResponseCode();
string telephone = message_p->getTelephone();
string id = message_p->getTxId();
{
QueryManager queryManager;
queryManager.begin();
QueryManager::AcceptState acceptState;
acceptState = queryManager.delayReverseTx(
id
,ecc::pp::txs::state::ABORT
,ecc::pp::txs::evolve::PASIVE
,authorisationCode
,telephone
);
//aqui cacho los valores que voy a utilizar despues
a_tx
.messageFactory()
.setCacheOriginalDataElements(
queryManager
.createOriginalDataElements( a_tx.getId() )
);
cach( a_tx.messageFactory(), queryManager );
if( acceptState = QueryManager::ACCEPTED )
wt0430(a_tx);//checar que esta funcion solo puede mandar excepciones antes de mandar el mensaje
else
{
stringstream sstring;
sstring
<< "InitialRT0420::info:\n\t< MSG 522 >: La peticion de reverso, para la transaccion:-"
<< id
<< "-, y codigo de authorisacion: -"
<< authorisationCode
<< "-; no corresponden a ninguna transaccion autorizada.";
Log::instance().log( sstring.str().c_str() );
}
queryManager.isCommit(true);
a_tx.setEvent( Tx::DONE );
a_tx.setState( Tx::END );
}
}catch(Exception& e){
a_tx.setState( Tx::END );
a_tx.setEvent( Tx::EXCEPTION );
e
<< "catch in InitialRT0420::apply\n"
;
throw;
}catch(...){
a_tx.setState( Tx::END );
a_tx.setEvent( Tx::EXCEPTION );
throw;
}
}
开发者ID:edgarinformaticamodular,项目名称:mtx-transactional-monitor,代码行数:62,代码来源:InitialRT0420.cpp
示例15:
void InitialRT0421::apply(Tx& a_tx)
{
a_tx.timedWait();//parra quitar el primer counter del semaforo
d_txState = Tx::INITIAL;
d_event = Tx::RT0420;
}
开发者ID:edgarinformaticamodular,项目名称:mtx-transactional-monitor,代码行数:6,代码来源:InitialRT0421.cpp
示例16: push_back_return_index
inline static uint32 push_back_return_index(Tx& x, const Ty& y)
{
uint32 old_size = x.size();
x.push_back(y);
return old_size;
}
开发者ID:kayru,项目名称:reversez,代码行数:6,代码来源:GfxDeviceDX9.cpp
示例17: return
bool WT0420RT0430::isMatch(Tx& a_tx)
{
return (a_tx.getState() == Tx::WT0421 || a_tx.getState() == Tx::WT0420) && (a_tx.getEvent() == d_event);
}
开发者ID:edgarinformaticamodular,项目名称:mtx-transactional-monitor,代码行数:4,代码来源:WT0420RT0430.cpp
示例18: destroy
inline void destroy(const Tx tx, Alloc& alloc, T* t)
{
tx.sometime_synchronized_after(
[ alloc, t ]() mutable noexcept { AllocTraits::destroy(alloc, t); });
}
开发者ID:mtak-,项目名称:lockfree-stm,代码行数:5,代码来源:memory.hpp
示例19: construct
inline void construct(const Tx tx, Alloc& alloc, T* t, Args&&... args)
{
AllocTraits::construct(alloc, t, (Args &&) args...);
tx.after_fail([ alloc, t ]() mutable noexcept { AllocTraits::destroy(alloc, t); });
}
开发者ID:mtak-,项目名称:lockfree-stm,代码行数:5,代码来源:memory.hpp
示例20: transmit
void transmit(bool do_transmit)
{
is_transmitting = do_transmit;
tx->transmit(do_transmit);
}
开发者ID:8cH9azbsFifZ,项目名称:svxlink,代码行数:5,代码来源:Tx.cpp
注:本文中的Tx类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论