12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
-
- #ifndef MBED_TRANSACTION_H
- #define MBED_TRANSACTION_H
-
- #include "platform.h"
- #include "FunctionPointer.h"
-
- namespace mbed {
-
-
- typedef struct {
- void *tx_buffer;
- size_t tx_length;
- void *rx_buffer;
- size_t rx_length;
- uint32_t event;
- event_callback_t callback;
- uint8_t width;
- } transaction_t;
-
-
- template<typename Class>
- class Transaction {
- public:
- Transaction(Class *tpointer, const transaction_t& transaction) : _obj(tpointer), _data(transaction) {
- }
-
- Transaction() : _obj(), _data() {
- }
-
- ~Transaction() {
- }
-
-
-
- Class* get_object() {
- return _obj;
- }
-
-
-
- transaction_t* get_transaction() {
- return &_data;
- }
-
- private:
- Class* _obj;
- transaction_t _data;
- };
-
- }
-
- #endif
|