/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: common/rwset.proto */

#ifndef PROTOBUF_C_common_2frwset_2eproto__INCLUDED
#define PROTOBUF_C_common_2frwset_2eproto__INCLUDED

#include <protobuf-c/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif


typedef struct _Common__KeyVersion Common__KeyVersion;
typedef struct _Common__TxRead Common__TxRead;
typedef struct _Common__TxWrite Common__TxWrite;
typedef struct _Common__TxRWSet Common__TxRWSet;


/* --- enums --- */


/* --- messages --- */

/*
 * key read version
 */
struct  _Common__KeyVersion
{
  ProtobufCMessage base;
  /*
   * the transaction identifier that last modified the key
   */
  char *ref_tx_id;
  /*
   * the offset of the key in the write set of the transaction, starts from 0
   */
  int32_t ref_offset;
};
#define COMMON__KEY_VERSION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__key_version__descriptor) \
    , (char *)protobuf_c_empty_string, 0 }


/*
 * TxRead describes a read operation on a key
 */
struct  _Common__TxRead
{
  ProtobufCMessage base;
  /*
   * read key
   */
  ProtobufCBinaryData key;
  /*
   * the value of the key
   */
  ProtobufCBinaryData value;
  /*
   * contract name, used in cross-contract calls
   * set to null if only the contract in transaction request is called
   */
  char *contract_name;
  /*
   * read key version
   */
  Common__KeyVersion *version;
};
#define COMMON__TX_READ__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__tx_read__descriptor) \
    , {0,NULL}, {0,NULL}, (char *)protobuf_c_empty_string, NULL }


/*
 * TxRead describes a write/delete operation on a key
 */
struct  _Common__TxWrite
{
  ProtobufCMessage base;
  /*
   * write key
   */
  ProtobufCBinaryData key;
  /*
   * write value
   */
  ProtobufCBinaryData value;
  /*
   * contract name, used in cross-contract calls
   * set to null if only the contract in transaction request is called
   */
  char *contract_name;
};
#define COMMON__TX_WRITE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__tx_write__descriptor) \
    , {0,NULL}, {0,NULL}, (char *)protobuf_c_empty_string }


/*
 * TxRWSet describes all the operations of a transaction on ledger
 */
struct  _Common__TxRWSet
{
  ProtobufCMessage base;
  /*
   * transaction identifier
   */
  char *tx_id;
  /*
   * read set
   */
  size_t n_tx_reads;
  Common__TxRead **tx_reads;
  /*
   * write set
   */
  size_t n_tx_writes;
  Common__TxWrite **tx_writes;
};
#define COMMON__TX_RWSET__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__tx_rwset__descriptor) \
    , (char *)protobuf_c_empty_string, 0,NULL, 0,NULL }


/* Common__KeyVersion methods */
void   common__key_version__init
                     (Common__KeyVersion         *message);
size_t common__key_version__get_packed_size
                     (const Common__KeyVersion   *message);
size_t common__key_version__pack
                     (const Common__KeyVersion   *message,
                      uint8_t             *out);
size_t common__key_version__pack_to_buffer
                     (const Common__KeyVersion   *message,
                      ProtobufCBuffer     *buffer);
Common__KeyVersion *
       common__key_version__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__key_version__free_unpacked
                     (Common__KeyVersion *message,
                      ProtobufCAllocator *allocator);
/* Common__TxRead methods */
void   common__tx_read__init
                     (Common__TxRead         *message);
size_t common__tx_read__get_packed_size
                     (const Common__TxRead   *message);
size_t common__tx_read__pack
                     (const Common__TxRead   *message,
                      uint8_t             *out);
size_t common__tx_read__pack_to_buffer
                     (const Common__TxRead   *message,
                      ProtobufCBuffer     *buffer);
Common__TxRead *
       common__tx_read__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__tx_read__free_unpacked
                     (Common__TxRead *message,
                      ProtobufCAllocator *allocator);
/* Common__TxWrite methods */
void   common__tx_write__init
                     (Common__TxWrite         *message);
size_t common__tx_write__get_packed_size
                     (const Common__TxWrite   *message);
size_t common__tx_write__pack
                     (const Common__TxWrite   *message,
                      uint8_t             *out);
size_t common__tx_write__pack_to_buffer
                     (const Common__TxWrite   *message,
                      ProtobufCBuffer     *buffer);
Common__TxWrite *
       common__tx_write__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__tx_write__free_unpacked
                     (Common__TxWrite *message,
                      ProtobufCAllocator *allocator);
/* Common__TxRWSet methods */
void   common__tx_rwset__init
                     (Common__TxRWSet         *message);
size_t common__tx_rwset__get_packed_size
                     (const Common__TxRWSet   *message);
size_t common__tx_rwset__pack
                     (const Common__TxRWSet   *message,
                      uint8_t             *out);
size_t common__tx_rwset__pack_to_buffer
                     (const Common__TxRWSet   *message,
                      ProtobufCBuffer     *buffer);
Common__TxRWSet *
       common__tx_rwset__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__tx_rwset__free_unpacked
                     (Common__TxRWSet *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Common__KeyVersion_Closure)
                 (const Common__KeyVersion *message,
                  void *closure_data);
typedef void (*Common__TxRead_Closure)
                 (const Common__TxRead *message,
                  void *closure_data);
typedef void (*Common__TxWrite_Closure)
                 (const Common__TxWrite *message,
                  void *closure_data);
typedef void (*Common__TxRWSet_Closure)
                 (const Common__TxRWSet *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor common__key_version__descriptor;
extern const ProtobufCMessageDescriptor common__tx_read__descriptor;
extern const ProtobufCMessageDescriptor common__tx_write__descriptor;
extern const ProtobufCMessageDescriptor common__tx_rwset__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_common_2frwset_2eproto__INCLUDED */
