Changeset 5969 for pjproject/trunk/pjsip/include/pjsua2/presence.hpp
- Timestamp:
- Apr 15, 2019 10:52:16 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua2/presence.hpp
r5672 r5969 169 169 */ 170 170 PresenceStatus presStatus; 171 171 172 172 public: 173 173 /** Import from pjsip structure */ … … 189 189 190 190 /** 191 * Buddy. 191 * Buddy. This is a lite wrapper class for PJSUA-LIB buddy, i.e: this class 192 * only maintains one data member, PJSUA-LIB buddy ID, and the methods are 193 * simply proxies for PJSUA-LIB buddy operations. 194 * 195 * Application can use create() to register a buddy to PJSUA-LIB, and 196 * the destructor of the original instance (i.e: the instance that calls 197 * create()) will unregister and delete the buddy from PJSUA-LIB. Application 198 * must delete all Buddy instances belong to an account before shutting down 199 * the account (via Account::shutdown()). 200 * 201 * The library will not keep a list of Buddy instances, so any Buddy (or 202 * descendant) instances instantiated by application must be maintained 203 * and destroyed by the application itself. Any PJSUA2 APIs that return Buddy 204 * instance(s) such as Account::enumBuddies2() or Account::findBuddy2() will 205 * just return generated copy. All Buddy methods should work normally on this 206 * generated copy instance. 192 207 */ 193 208 class Buddy … … 200 215 201 216 /** 202 * Destructor. Note that if the Buddy instance is deleted, it will also 203 * delete the corresponding buddy in the PJSUA-LIB. 217 * Destructor. Note that if the Buddy original instance (i.e: the instance 218 * that calls Buddy::create()) is destroyed, it will also delete the 219 * corresponding buddy in the PJSUA-LIB. While the destructor of 220 * a generated copy (i.e: Buddy instance returned by PJSUA2 APIs such as 221 * Account::enumBuddies2() or Account::findBuddy2()) will do nothing. 204 222 */ 205 223 virtual ~Buddy(); … … 207 225 /** 208 226 * Create buddy and register the buddy to PJSUA-LIB. 227 * 228 * Note that application should maintain the Buddy original instance, i.e: 229 * the instance that calls this create() method as it is only the original 230 * instance destructor that will delete the underlying Buddy in PJSUA-LIB. 209 231 * 210 232 * @param acc The account for this buddy. … … 298 320 * Buddy ID. 299 321 */ 300 pjsua_buddy_id id; 301 302 /** 303 * Account. 304 */ 305 Account *acc; 306 }; 307 322 pjsua_buddy_id id; 323 324 private: 325 friend class Endpoint; 326 friend class Account; 327 328 /* Internal constructor/methods used by Endpoint and Account */ 329 Buddy(pjsua_buddy_id buddy_id); 330 Buddy *getOriginalInstance(); 331 }; 332 333 334 /** 335 * Warning: deprecated, use BuddyVector2 instead. 336 * 337 * Array of buddies. 338 */ 339 typedef std::vector<Buddy*> BuddyVector; 308 340 309 341 /** Array of buddies */ 310 typedef std::vector<Buddy *> BuddyVector;342 typedef std::vector<Buddy> BuddyVector2; 311 343 312 344
Note: See TracChangeset
for help on using the changeset viewer.