1 // Copyright 2012 Google Inc. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef POLO_PAIRING_MESSAGE_PAIRINGREQUESTMESSAGE_H_ 16 #define POLO_PAIRING_MESSAGE_PAIRINGREQUESTMESSAGE_H_ 17 18 #include <string> 19 20 #include "polo/pairing/message/polomessage.h" 21 22 namespace polo { 23 namespace pairing { 24 namespace message { 25 26 // A message to request a polo pairing session. 27 class PairingRequestMessage : public PoloMessage { 28 public: 29 // Creates a pairing request message with the given service name and no client 30 // name. 31 // @param service_name the service name 32 explicit PairingRequestMessage(const std::string& service_name); 33 34 // Creates a pairing request message with the given service name and client 35 // name. 36 // @param service_name the service name 37 // @param client_name the client name 38 PairingRequestMessage(const std::string& service_name, 39 const std::string& client_name); 40 41 // Gets the service name. 42 std::string service_name() const; 43 44 // Gets the client name. 45 std::string client_name() const; 46 47 // Gets whether there is a client name. 48 bool has_client_name() const; 49 50 // @override 51 virtual std::string ToString() const; 52 private: 53 std::string service_name_; 54 std::string client_name_; 55 56 DISALLOW_COPY_AND_ASSIGN(PairingRequestMessage); 57 }; 58 59 } // namespace message 60 } // namespace pairing 61 } // namespace polo 62 63 #endif // POLO_PAIRING_MESSAGE_PAIRINGREQUESTMESSAGE_H_ 64