Guest User

Untitled

a guest
Jul 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <graphene/db/object.hpp>
  4. #include <graphene/db/generic_index.hpp>
  5. #include <graphene/chain/protocol/types.hpp>
  6. #include <boost/multi_index_container_fwd.hpp>
  7.  
  8. using std::string;
  9.  
  10. namespace graphene
  11. {
  12. namespace chain
  13. {
  14. /**
  15. *Definition of user object
  16. ** Save user data while account creation.
  17. */
  18. class user_object : public graphene::db::abstract_object<user_object>
  19. {
  20. public:
  21. static const uint8_t space_id = implementation_ids;
  22. static const uint8_t type_id = impl_user_object_type;
  23.  
  24. //Number to identify the user object.
  25. account_id_type external_user_account; //graphene user account
  26. string FirstName;
  27. string PhoneNumber;
  28. };
  29.  
  30. // These structures are used in the multi_index_container....
  31. struct by_external_user_account;
  32.  
  33. // creating object index
  34. typedef multi_index_container<
  35. user_object,
  36. indexed_by<
  37. ordered_unique<
  38. tag<by_id>, member<object, object_id_type, &object::id>>,
  39. ordered_unique<
  40. tag<by_external_user_account>, member<user_object, account_id_type, &user_object::external_user_account>>>>
  41. user_object_index_type;
  42.  
  43. typedef generic_index<user_object, user_object_index_type> user_index;
  44.  
  45. } // namespace chain
  46. } // namespace graphene
  47.  
  48. FC_REFLECT_DERIVED(graphene::chain::user_object, (graphene::db::object),
  49. (external_user_account)(FirstName)(PhoneNumber));
Add Comment
Please, Sign In to add comment