MessageField.h 769 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright: All Rights Reserved
  2. // Author: egametang@gmail.com (tanghai)
  3. #ifndef ORM_MESSAGEFIELD_H
  4. #define ORM_MESSAGEFIELD_H
  5. #include <string>
  6. #include <google/protobuf/message.h>
  7. #include "Orm/Typedef.h"
  8. namespace Egametang {
  9. class MessageField
  10. {
  11. private:
  12. google::protobuf::Message& message;
  13. const google::protobuf::FieldDescriptor* field;
  14. std::string GetRepeatedField();
  15. std::string GetOptionalField();
  16. void SetRepeatedField(ResultSetPtr resultSet);
  17. void SetOptionalField(ResultSetPtr resultSet);
  18. public:
  19. MessageField(google::protobuf::Message& message,
  20. const google::protobuf::FieldDescriptor* field);
  21. ~MessageField();
  22. std::string GetField();
  23. void SetField(ResultSetPtr resultSet);
  24. };
  25. } // namespace Egametang
  26. #endif // ORM_MESSAGEFIELD_H