0fd43d410d8bd00187d99bd894e80eab1e435b20
[platform/upstream/iotivity.git] / service / resource-encapsulation / include / RCSAddress.h
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 /**
22  * @file
23  *
24  * This file contains the declaration of classes and its members related to RCSAddress
25  */
26 #ifndef OIC_SERVICE_RCSADDRESS_H
27 #define OIC_SERVICE_RCSADDRESS_H
28
29 #include <string>
30 #include <memory>
31
32 namespace OIC
33 {
34     namespace Service
35     {
36         class RCSAddressDetail;
37
38         /**
39          * This is to specify a target address to discover.
40          *
41          * @see RCSDiscoveryManager
42          */
43         class RCSAddress
44         {
45         public:
46             /**
47              * Factory method for multicast.
48              *
49              */
50             static RCSAddress multicast();
51
52             /**
53              * Factory method for unicast.
54              *
55              * @param address A physical address for the target.
56              */
57             static RCSAddress unicast(const std::string& address);
58
59             /**
60              * @overload
61              */
62             static RCSAddress unicast(std::string&& address);
63
64         private:
65             RCSAddress(const std::shared_ptr< RCSAddressDetail >&);
66
67         private:
68             std::shared_ptr< RCSAddressDetail > m_detail;
69
70             friend class RCSAddressDetail;
71         };
72     }
73 }
74
75 #endif // OIC_SERVICE_RCSADDRESS_H