00001 /** 00002 Licensed to the Apache Software Foundation (ASF) under one 00003 or more contributor license agreements. See the NOTICE file 00004 distributed with this work for additional information 00005 regarding copyright ownership. The ASF licenses this file 00006 to you under the Apache License, Version 2.0 (the 00007 "License"); you may not use this file except in compliance 00008 with the License. You may obtain a copy of the License at 00009 00010 http://www.apache.org/licenses/LICENSE-2.0 00011 00012 Unless required by applicable law or agreed to in writing, software 00013 distributed under the License is distributed on an "AS IS" BASIS, 00014 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 See the License for the specific language governing permissions and 00016 limitations under the License. 00017 */ 00018 /** 00019 * @file Response.h 00020 */ 00021 00022 #pragma once 00023 #ifndef ATSCPPAPI_RESPONSE_H_ 00024 #define ATSCPPAPI_RESPONSE_H_ 00025 00026 #include <atscppapi/Headers.h> 00027 #include <atscppapi/HttpVersion.h> 00028 #include <atscppapi/HttpStatus.h> 00029 00030 namespace atscppapi { 00031 00032 // forward declarations 00033 struct ResponseState; 00034 namespace utils { class internal; } 00035 00036 /** 00037 * @brief Encapsulates a response. 00038 */ 00039 class Response: noncopyable { 00040 public: 00041 Response(); 00042 00043 /** @return HTTP version of the response */ 00044 HttpVersion getVersion() const; 00045 00046 /** @return Status code of the response */ 00047 HttpStatus getStatusCode() const; 00048 00049 /** @param New status code to set */ 00050 void setStatusCode(HttpStatus); 00051 00052 /** @return Reason phrase of the response */ 00053 std::string getReasonPhrase() const; 00054 00055 /** @param New reason phrase to set */ 00056 void setReasonPhrase(const std::string &); 00057 00058 /** @return Headers of the response */ 00059 Headers &getHeaders() const; 00060 00061 ~Response(); 00062 private: 00063 ResponseState *state_; 00064 void init(void *hdr_buf, void *hdr_loc); 00065 friend class Transaction; 00066 friend class utils::internal; 00067 }; 00068 00069 } 00070 00071 #endif