📄 dpentryrecord.hxx
字号:
#ifndef DPENTRYRECORD_HXX
#define DPENTRYRECORD_HXX
#include "Record.hxx"
/** This class derives from 'Record' superclass to implement
* 'Dial Plan Entry' Record.
*
* DPEntryRecord.hxx version 1.0 -- 19 Mar 2003
* Suha Cubukcuoglu
*/
class DPEntryRecord : public Record
{
public:
/** Constructor */
DPEntryRecord();
/** Destructor */
~DPEntryRecord();
/**
* Populates this object from the database. Key is the key used
* to retrieve information, dbcon is a connection to the database
* (provided by the DBManager).
*/
virtual bool populateRecord(KeyType key, DBConnection* dbcon);
/**
* Amends this object in the database, returns true if nothing
* goes wrong.
*/
virtual bool amendRecord(DBConnection* dbconn);
/**
* Deletes this object from the database,
* returns true if nothing goes wrong.
*/
virtual bool deleteRecord(DBConnection* dbconn);
/**
* Inserts this object in the database,
* returns true if nothing goes wrong.
*/
virtual bool insertRecord(DBConnection* dbconn);
/**
* This function queries the database and returns a
* list of all the relavent keys that could be used
* to retrieve records of this type.
*/
virtual KeyList getAllKeys(DBConnection* dbconn);
virtual void displayRecord();
/** This structure defines a Dial Plan entry. */
typedef struct dpEntry {
// name of the Dial Plan that stores this record */
string DP;
// The Regex 'key', e.g. ^sip:7000
string key;
// SIP contact address, e.g. sip:$USER@127.0.0.1:5110;user=phone
string contact;
} dpEntry;
/** sets the Dial Plan to which this entry belongs */
void setDP(string s) { dpe.DP = s; };
/** sets the Regex 'key' for this Dial Plan entry */
void setKey(string k) { dpe.key = k; };
/** sets the 'SIP contact' address for this Dial Plan entry */
void setContact(string c) { dpe.contact = c; };
/** accessor to Dial Plan */
string getDP() { return dpe.DP; };
/** accessor to key */
string getKey() { return dpe.key; };
/** accessor to contact */
string getContact() { return dpe.contact; };
private:
/** declare a DP entry */
dpEntry dpe;
};
#endif /** DPENTRYRECORD_HXX */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -