summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h')
-rw-r--r--qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h73
1 files changed, 29 insertions, 44 deletions
diff --git a/qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h b/qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h
index 25acb0a940..9312a2911b 100644
--- a/qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h
+++ b/qpid/cpp/src/qpid/linearstore/jrnl/utils/txn_hdr.h
@@ -21,57 +21,42 @@
*
*/
-/**
- * \file txn_hdr.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::txn_hdr (transaction
- * record header), used to start a transaction (commit or abort) record.
- *
- * \author Kim van der Riet
- */
-
#include "rec_hdr.h"
#pragma pack(1)
/**
-* \brief Struct for transaction commit and abort records.
-*
-* Struct for DTX commit and abort records. Only the magic distinguishes between them. Since
-* this record must be used in the context of a valid XID, the xidsize field must not be zero.
-* Immediately following this record is the XID itself which is xidsize bytes long, followed by
-* a rec_tail.
-*
-* Note that this record had its own rid distinct from the rids of the record(s) making up the
-* transaction it is committing or aborting.
-*
-* Record header info in binary format (24 bytes):
-* <pre>
-* 0 7
-* +---+---+---+---+---+---+---+---+ -+
-* | magic | v | e | flags | |
-* +---+---+---+---+---+---+---+---+ | struct hdr
-* | rid | |
-* +---+---+---+---+---+---+---+---+ -+
-* | xidsize |
-* +---+---+---+---+---+---+---+---+
-* v = file version (If the format or encoding of this file changes, then this
-* number should be incremented)
-* e = endian flag, false (0x00) for little endian, true (0x01) for big endian
-* </pre>
-*
-* Note that journal files should be transferable between 32- and 64-bit
-* hardware of the same endianness, but not between hardware of opposite
-* entianness without some sort of binary conversion utility. Thus buffering
-* will be needed for types that change size between 32- and 64-bit compiles.
-*/
+ * \brief Struct for transaction commit and abort records.
+ *
+ * Struct for local and DTX commit and abort records. Only the magic distinguishes between them.
+ * Since this record must be used in the context of a valid XID, the xidsize field must not be
+ * zero. Immediately following this record is the XID itself which is xidsize bytes long,
+ * followed by a rec_tail.
+ *
+ * Note that this record had its own rid distinct from the rids of the record(s) making up the
+ * transaction it is committing or aborting.
+ *
+ * Record header info in binary format (24 bytes):
+ * <pre>
+ * 0 7
+ * +---+---+---+---+---+---+---+---+ -+
+ * | magic | v | e | flags | |
+ * +---+---+---+---+---+---+---+---+ | struct rec_hdr_t
+ * | rid | |
+ * +---+---+---+---+---+---+---+---+ -+
+ * | xidsize |
+ * +---+---+---+---+---+---+---+---+
+ * </pre>
+ */
typedef struct txn_hdr_t {
- rec_hdr_t _rhdr;
- uint64_t _xidsize; ///< XID size
+ rec_hdr_t _rhdr; /**< Common record header struct */
+ uint64_t _xidsize; /**< XID size */
} txn_hdr_t;
+void txn_hdr_init(txn_hdr_t* dest, const uint32_t magic, const uint16_t version, const uint16_t uflag,
+ const uint64_t rid, const uint64_t xidsize);
+void txn_hdr_copy(txn_hdr_t* dest, const txn_hdr_t* src);
+
#pragma pack()
-#endif // ifndef QPID_LINEARSTORE_JRNL_UTILS_TXN_HDR_H
+#endif /* ifndef QPID_LINEARSTORE_JRNL_UTILS_TXN_HDR_H */