dprecord.cxx

来自「vovida的软交换」· CXX 代码 · 共 87 行

CXX
87
字号
#include "DPRecord.hxx"
#include <iostream>

/*  This implements 'Dial Plan' subclass of the
 *  'Record' superclass.
 *
 *  DPRecord.cxx                 version 1.0 -- 19 Mar 2003
 *                               Suha Cubukcuoglu         
 */
 
DPRecord::DPRecord()
{
	setRecordType(DP_RECORD);
}

DPRecord::~DPRecord() {}

void DPRecord::displayRecord()
{
	cout << "Displaying Dial Plan Record:\n";
    cout << "--------------------------"      <<"\n";
    cout << "Dial Plan : " << getName()       <<"\n";
    
    dpitr i;
    i = dialPlan.begin();
    
    cout << "PRIORITY    " << "KEY        " << "CONTACT    ";
    cout << "********    " << "***        " << "*******    ";
    cout << "\n\n"; 
    
    for (; i != dialPlan.end(); i++){
    	cout << i->first           <<"          ";      
        cout << i->second.key      <<"          ";          
    	cout << i->second.contact  <<"\n";
   	}
   	
}

bool DPRecord::populateRecord(KeyType key, DBConnection* dbcon) 
{ 
    setKey(key);
   
    cout << "Called Populate Record: key=" << key << " in Dial Plan Record\n\n";
                      
    return false;
}
 
bool DPRecord::amendRecord(DBConnection* dbconn)
{
    cout << "Called Amend Record in Dial Plan Record\n";

    // Would do a database AMEND here

    return false;
}

bool DPRecord::deleteRecord(DBConnection* dbconn)
{
    cout << "Called Delete Record in Dial Plan Record\n";

    // Would do a database DELETE here

    return false;
}

bool DPRecord::insertRecord(DBConnection* dbconn)
{
    cout << "Called Insert Record in Dial Plan Record\n";

    // Would do a database INSERT here

    return false;
}

KeyList DPRecord::getAllKeys(DBConnection* dbconn)
{ 
  KeyList l; 
  cout << "Called getAllKeys in Dial Plan Record\n";

  // Would do a database SELECT to get all relavent keys and 
  // return them in key list

  l.push_back("1");

  return l;
} 	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?