remove link in brief tag
[platform/framework/native/net.git] / inc / FNetNetEndPoint.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FNetNetEndPoint.h
20  * @brief               This is the header file for the %NetEndPoint class.
21  *
22  * This header file contains the declarations of the %NetEndPoint class.
23  */
24 #ifndef _FNET_NET_END_POINT_H_
25 #define _FNET_NET_END_POINT_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FNetIpAddress.h>
30 #include <FNetSockSocketTypes.h>
31
32 namespace Tizen { namespace Net
33 {
34 class _NetEndPointImpl;
35
36 /**
37  * @class       NetEndPoint
38  * @brief       This class identifies the network address.
39  *
40  * @since       2.0
41  *
42  * The %NetEndPoint class provides a base class that represents the network address of a resource or service.
43  *
44  */
45 class _OSP_EXPORT_ NetEndPoint
46         : public Tizen::Base::Object
47 {
48 public:
49         /**
50          *      This is the default constructor for this class.
51          *
52          *      @since  2.0
53          */
54         NetEndPoint(void);
55
56         /**
57          * Initializes this instance of %NetEndPoint with the specified address and port number.
58          *
59          * @since       2.0
60          *
61          * @param[in]   ipAddress       The IP address of the target endpoint
62          * @param[in]   port                    The port number
63          * @exception   E_SUCCESS       The instance is initialized successfully.
64          * @exception   E_INVALID_ARG   A specified input parameter is invalid.
65          * @remarks         The GetLastResult() method is used to check whether the %NetEndPoint instance is created successfully.
66          */
67         NetEndPoint(const IpAddress& ipAddress, unsigned short port);
68
69         /**
70          * Copying of objects using this copy constructor is allowed.
71          *
72          * @since                       2.0
73          *
74          * @param[in]   rhs                     An instance of %NetEndPoint
75          * @exception   E_SUCCESS       The instance is initialized successfully.
76          * @exception   E_INVALID_ARG   The specified input parameter is invalid.
77          * @remarks         The GetLastResult() method is used to check whether the %NetEndPoint instance is created successfully.
78          */
79         NetEndPoint(const NetEndPoint& rhs);
80
81         /**
82          *      This destructor overrides Tizen::Base::Object::~Object().
83          *
84          * @since       2.0
85          */
86         virtual ~NetEndPoint(void);
87
88         /**
89          * Gets the address family to which the calling %NetEndPoint instance belongs.
90          *
91          * @since       2.0
92          *
93          * @return              The address family of the calling instance
94          * @exception   E_SUCCESS                       The method is successful.
95          * @exception   E_INVALID_STATE         This instance is in an invalid state.
96          */
97         NetAddressFamily GetNetAddressFamily(void) const;
98
99         /**
100          * Gets the port number of the endpoint.
101          *
102          * @since       2.0
103          *
104          * @return              The port number of the endpoint
105          * @exception   E_SUCCESS                       The method is successful.
106          * @exception   E_INVALID_STATE         This instance is in an invalid state.
107          */
108         unsigned short GetPort(void) const;
109
110         /**
111          * Gets the IP address of the calling instance.
112          *
113          * @since       2.0
114          *
115          * @return              The IP address of the endpoint, @n
116          *                              else @c null if the address information is invalid
117          * @exception   E_SUCCESS                       The method is successful.
118          * @exception   E_INVALID_STATE         This instance is in an invalid state.
119          */
120         IpAddress* GetAddress(void) const;
121
122         /**
123          * Gets the current endpoint.
124          *
125          * @since       2.0
126          *
127          * @return              The current endpoint, @n
128          *                              else @c null string if an error occurs
129          * @exception   E_SUCCESS                       The method is successful.
130          * @exception   E_INVALID_STATE         This instance is in an invalid state.
131          * @remarks             
132          *                      - The string output of this method is formatted as follows: IPADDRESS:PORT. @n
133          *                      IPADDRESS is a string representing a number expressed in the Internet Standard "." (dotted) notation (for example, 165.213.173.7). @n
134          *                      PORT is a string representing a port number in host byte order. For example, 165.213.173.7:2000 is a possible string.
135          *                      - The specific error code can be accessed using the GetLastResult() method.
136          */
137         Tizen::Base::String GetNetEndPoint(void) const;
138
139         /**
140          * Copying of objects using this copy assignment operator is allowed.
141          *
142          * @since               2.0
143          *
144          * @return              The reference of this instance
145          * @param[in]   rhs An instance of %NetEndPoint
146          * @remarks             The GetLastResult() method is used to check whether the %NetEndPoint instance is copied successfully.
147          */
148         NetEndPoint& operator =(const NetEndPoint& rhs);
149
150         /**
151          * Compares the specified instance of %NetEndPoint with the calling instance.
152          *
153          * @since               2.0
154          *
155          * @return              @c true if the values match, @n
156          *                              else @c false
157          * @param[in]   rhs     The other Tizen::Base::Object to compare
158          * @see                 Tizen::Base::Object::Equals()
159          */
160         virtual bool Equals(const Tizen::Base::Object& rhs) const;
161
162         /**
163          * Gets the hash value of the current instance.
164          *
165          * @since               2.0
166          *
167          * @return      The hash value of the current instance
168          */
169         virtual int GetHashCode(void) const;
170
171 private:
172         _NetEndPointImpl* __pNetEndPointImpl;
173
174         friend class _NetEndPointImpl;
175 }; // NetEndPoint
176
177 } } //Tizen::Net
178
179 #endif // _FNET_NET_END_POINT_H_