📄 ptprovider.h
字号:
//:Sets <i>rpAddress</i> to refer to the PtAddress corresponding to the //:specified phone number or NULL if there is no corresponding address. //!param: (in) phoneURL - a URL representing the phone number to look up //!param: (out) rAddress - reference to the address object corresponding to phoneURL //!retcode: PT_SUCCESS - success //!retcode: PT_INVALID_ARGUMENT - <i>phoneURL</i> was not recognized //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available// PtStatus getAddresses(PtAddress& arAddresses[], int size, int& nItems); virtual PtStatus getAddresses(PtAddress arAddresses[], int size, int& nItems); //: TRICKY: array of reference are illegal, avoid using reference here. //:Returns an array of references to PtAddress objects that are known to //:the provider and within its domain. // The caller provides an array that can hold up to <i>size</i> // PtAddress references. This method will fill in the <i>addresses</i> // array with up to <i>size</i> references. The actual number of references // filled in is passed back via the <i>nItems</i> argument. //!param: (out) arAddresses - the array of PtAddress references //!param: (in) size - the number of elements in the <i>addresses</i> array //!param: (out) nItems - the number of items assigned //!retcode: PT_SUCCESS - success //!retcode: PT_MORE_DATA - there are more than <i>size</i> addresses //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available //PtStatus getCalls(PtCall& arCalls[], int size, int& nItems); virtual PtStatus getCalls(PtCall arCalls[], int size, int& nItems); //:WARNING: array of reference are illegal try to avoid it. //:Returns an array of references to PtCall objects that are known to the //:provider. // The caller provides an array that can hold up to <i>size</i> // PtCall references. This method will fill in the <i>calls</i> array with // up to <i>size</i> references. The actual number of references filled in // is passed back via the <i>nItems</i> argument. //!param: (out) arCalls - the array of PtCall pointers //!param: (in) size - the number of elements in the <i>calls</i> array //!param: (out) nItems - the number of items assigned //!retcode: PT_SUCCESS - success //!retcode: PT_MORE_DATA - there are more than <i>size</i> calls //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available virtual PtStatus getProviderListeners(PtProviderListener* listeners[], int size, int& nItems); //:Returns an array of pointers to PtProviderListener objects that have //:been registered with this provider. // The caller provides an array that can hold up to <i>size</i> // PtProviderListener pointers. This method will fill in the // <i>listeners</i> array with up to <i>size</i> pointers. The actual // number of pointers filled in is passed back via the <i>nItems</i> // argument. //!param: (out) listeners - the array of PtProviderListener pointers //!param: (in) size - the number of elements in the <i>pListeners</i> array //!param: (out) nItems - the number of items assigned //!retcode: PT_SUCCESS - success //!retcode: PT_MORE_DATA - there are more than <i>size</i> listeners //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available virtual int getState(void); //:Returns the current state of the provider, either IN_SERVICE, //:OUT_OF_SERVICE or SHUTDOWN. //!retcode: IN_SERVICE - the provider is available for use //!retcode: OUT_OF_SERVICE - the provider is temporarily unavailable //!retcode: SHUTDOWN - the provider is permanently unavailable virtual PtStatus getTerminal(const char* name, PtTerminal& rTerminal); //:Assigns to <i>rTerminal</i> the PtTerminal corresponding to the //:specified name. //!param: (in) name - the name to look up (typically the phone extension) //!param: (out) rpTerminal - the terminal object for name //!retcode: PT_SUCCESS - success //!retcode: PT_INVALID_ARGUMENT - name was not recognized //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available// PtStatus getTerminals(PtTerminals& arTerms[], int size, int& nItems); virtual PtStatus getTerminals(PtTerminal arTerms[], int size, int& nItems); //:WARNING: avoid using array of reference. //:Returns an array of references to PtTerminal objects that are known to //:the provider and within its domain. // The caller provides an array that can hold up to <i>size</i> // PtTerminal references. This method will fill in the <i>terms</i> array // with up to <i>size</i> references. The actual number of references // filled in is passed back via the <i>nItems</i> argument. //!param: (out) arTerms - the array of PtTerminal references //!param: (in) size - the number of elements in the <i>terms</i> array //!param: (out) nItems - the number of items assigned //!retcode: PT_SUCCESS - success //!retcode: PT_MORE_DATA - there are more than <i>size</i> terminals //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available virtual PtStatus numAddresses(int& count); //:Returns the number of addresses currently known to this provider and //:within its domain. //!param: (out) count - the number of addresses known to this provider //!retcode: PT_SUCCESS - success //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available virtual PtStatus numCalls(int& count); //:Returns the number of calls currently known to this provider. //!param: (out) count - the number of calls known to this provider //!retcode: PT_SUCCESS - success //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available virtual PtStatus numProviderListeners(int& count); //:Returns the number of PtProviderListeners currently registered with //:this provider. //!param: (out) count - the number of listeners known to this provider //!retcode: PT_SUCCESS - success //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available virtual PtStatus numTerminals(int& count); //:Returns the number of terminals currently known to this provider and //:within its domain. //!param: (out) count - the number of terminals known to this provider //!retcode: PT_SUCCESS - success //!retcode: PT_PROVIDER_UNAVAILABLE - the provider is not available/* ============================ INQUIRY =================================== */friend class PtTerminal;/* //////////////////////////// PROTECTED ///////////////////////////////// */protected: static OsBSem semInit ; //: Binary Semaphore used to guard initialiation and tear down static PtProvider* spInstance; // pointer to the single instance of static TaoClientTask *mpClient; static TaoReference *mpTransactionCnt; static TaoObjectMap *mpCalls; static TaoReference *mpCallCnt; static TaoObjectMap *mpAddresses; static TaoReference *mpAddressCnt; static unsigned int mRef; UtlString mLogin; UtlString mPass; ProviderState mState; OsTime mTimeOut; void initialize(); PtStatus createProvider(const char* login, const char* password, const char* server, const char* options, CpCallManager* pCallMgr = NULL); PtProvider(const char* login, const char* password, const char* server, const char* options, CpCallManager* pCallMgr = NULL); PtProvider(const PtProvider& rPtProvider); //:Copy constructor (not implemented for this class) PtProvider& operator=(const PtProvider& rhs); //:Assignment operator (not implemented for this class) PtProvider(UtlString& rLogin, UtlString& rPass); PtProvider(); //:Default constructor virtual ~PtProvider(); //:Destructor/* //////////////////////////// PRIVATE /////////////////////////////////// */private: OsProtectEventMgr *mpEventMgr; static UtlBoolean mbInvalidIP; // the Pinger class static OsBSem sLock; // semaphore used to ensure that there // is only one instance of this class static UtlBoolean isLocal(const char* host);};/* ============================ INLINE METHODS ============================ */#endif // _PtProvider_h_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -