[#TxGraph-Ref]
= xref:TxGraph.adoc[TxGraph]::Ref
:relfileprefix: ../
:mrdocs:

Data type used to reference transactions within a TxGraph&period;

== Synopsis

Declared in `&lt;txgraph&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Ref;
----

== Description

Every transaction within a TxGraph has exactly one corresponding TxGraph&colon;&colon;Ref, held by users of the class&period; Destroying the TxGraph&colon;&colon;Ref removes the corresponding transaction (in both the main and staging graphs)&period;

Users of the class can inherit from TxGraph&colon;&colon;Ref&period; If all Refs are inherited this way, the Ref&ast; pointers returned by TxGraph functions can be cast to, and used as, this inherited type&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:TxGraph/Ref/2constructor-0a.adoc[`Ref`]         [.small]#[constructor]#
| Constructors
| xref:TxGraph/Ref/2destructor.adoc[`&#126;Ref`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this Ref&period; If it is not empty, the corresponding transaction is removed (in both main and staging, if it exists)&period;
| xref:TxGraph/Ref/operator_assign-01.adoc[`operator&equals;`] 
| Assignment operators
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:TxGraph.adoc[TxGraph]`
| Data structure to encapsulate fees, sizes, and dependencies for a set of transactions&period;
|===

== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:CTxMemPoolEntry.adoc[`CTxMemPoolEntry`] 
| CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in&hyphen;mempool transactions that depend on the transaction (&quot;descendant&quot; transactions)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
