llcorehttpopsetget.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. * @file llcorehttpopsetget.h
  3. * @brief Internal declarations for the HttpOpSetGet subclass
  4. *
  5. * $LicenseInfo:firstyear=2012&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2012, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef _LLCORE_HTTP_OPSETGET_H_
  27. #define _LLCORE_HTTP_OPSETGET_H_
  28. #include "curl/curl.h"
  29. #include "llcorehttpcommon.h"
  30. #include "llcorehttpoperation.h"
  31. #include "llcorerefcounted.h"
  32. namespace LLCore
  33. {
  34. // HttpOpSetGet requests dynamic changes to policy and configuration settings.
  35. //
  36. // *NOTE: Expect this to change. Don't really like it yet.
  37. // *TODO: Can't return values to caller yet. Need to do something better with
  38. // HttpResponse and visitNotifier().
  39. class HttpOpSetGet final : public HttpOperation
  40. {
  41. public:
  42. typedef std::shared_ptr<HttpOpSetGet> ptr_t;
  43. HttpOpSetGet();
  44. HttpOpSetGet(const HttpOpSetGet&) = delete;
  45. void operator=(const HttpOpSetGet&) = delete;
  46. /// Threading: called by application thread
  47. HttpStatus setupGet(HttpRequest::EPolicyOption opt,
  48. HttpRequest::policy_t pclass);
  49. HttpStatus setupSet(HttpRequest::EPolicyOption opt,
  50. HttpRequest::policy_t pclass, long value);
  51. HttpStatus setupSet(HttpRequest::EPolicyOption opt,
  52. HttpRequest::policy_t pclass,
  53. const std::string& value);
  54. virtual void stageFromRequest(HttpService*);
  55. public:
  56. // Reply Data
  57. long mReplyLongValue;
  58. std::string mReplyStrValue;
  59. // Request data
  60. HttpRequest::EPolicyOption mReqOption;
  61. HttpRequest::policy_t mReqClass;
  62. long mReqLongValue;
  63. std::string mReqStrValue;
  64. bool mReqDoSet;
  65. };
  66. } // End namespace LLCore
  67. #endif // _LLCORE_HTTP_OPSETGET_H_