www.pudn.com > apdb2ndb.rar > atnPortConvTable.h
//
// NDB-APDB Convertion
// Declaration of NtaPortCon
//
//
// This class is most important class declaration.
// We convert NDB to APDB as follows
// (1) init. apdb, load NDB module
// (2) create the array which will pointto atnPortConv
// (3) convert NDB Eport
// (a) create APDB component and block associate with NDB Eport
// (b) create staPortTable and enter it to array of ptr. to atnPortTabpe
// (3) Convert NDB Conpornent and cport
// (4) Convert NDB instance and port
// (a) create APDB block
/// (b) create APDB port
// (c) make up atnPortConvEntiry
// (5) Convert NDB net to APDB net
// (a) Create APDB net
// (b) For each port which is connected with the net
// i) get port
// ii) find atnPortConv entry
// iii) connect APDB net with APDB port
//
//
// decraration of class atnPortComv
//
class atnPortConvTable;
class atnPortConv{
friend class atnPortConvTable;
NDB_OBJ_KIND obj_kind;
int ndb_pid;
const char *pathname;
int64_t blkid;
const char *stackname;
int64_t apdb_pid;
const char *portname;
char *suffixname;
AirPortInfo *PortInfo;
public:
atnPortConv() {
obj_kind = NDB_UNKNOWN_OBJ;
ndb_pid = 0;
apdb_pid =0;
PortInfo = NULL_PTR;
}
void dump();
};
class atnPortConvTable {
private:
int64_t max_portid;
atnPortConv ** port_conv_table;
atnPortConv *get_1_item(int64_t) ;
public:
atnPortConvTable(int64_t number_of_entey) ;
~atnPortConvTable(void) ;
entry_port(NDB_OBJ_KIND,int ndb_pid,AirPortInfo*);
int get_ndb_portid(int64_t) ;
NDB_OBJ_KIND get_ndb_port_kind(int64_t);
// AirPortInfo *get_PortInfo(NDB_OBJ_KIND,int) ;
void delete_entry(int64_t n) {
if( port_conv_table[n])
{
delete port_conv_table[n];
port_conv_table[n] = NULL;
}
}
void dump(void);
};