www.pudn.com > apdb2ndb.rar > atn_load_apdb.cc
//
//
//
//
#include "atn_inc.h"
// MSG OK
ATN_FDEF int atn_load_apdb(atn_com &com)
{
int rcode =0;
int rc = 0;
try {
com.part = new AirPart();
}
catch(...) {
com.afm->message("atn0800",
AIR_MSG_CHR,"file",__FILE__,
AIR_MSG_INT,"line",__LINE__,AIR_MSG_END);
atn_debug(__FILE__,__LINE__,
"eception occurs durryng constructor of Part\n");
rcode = -1;
goto exit_func;
}
rc = com.part->init(*com.apif,com.part_name);
if(rc != 0)
{
atn_debug(__FILE__,__LINE__,
"arror durring part->init rc(%d)\n",rc);
}
rc = com.part->set_directory(com.in_path_name);
try {
com.arch = new AirArch;
}
catch(...) {
com.afm->message("atn0800",
AIR_MSG_CHR,"file",__FILE__,
AIR_MSG_INT,"line",__LINE__,AIR_MSG_END);
atn_debug(__FILE__,__LINE__,
"eception occurs durryng constructor of AirArch\n");
rcode = -1;
goto exit_func;
}
rc = com.arch->init(*com.part);
switch(rc)
{
case AIR_R_SUCCESS:
break;
default:
atn_debug(__FILE__,__LINE__,"arch->init failue rc(%d)\n",rc);
com.afm->message("atn0400",
AIR_MSG_CHR,"init arc",
AIR_MSG_CHR,"file",__FILE__,
AIR_MSG_INT,"line",__LINE__,AIR_MSG_END);
rcode = -1;
goto exit_func;
break;
}
rc = com.arch->load(com.in_path_name,com.arch_name,AIR_LATEST);
switch(rc)
{
case AIR_R_SUCCESS:
break;
default:
atn_debug(__FILE__,__LINE__,"arch->load failue rc(%d)\n",rc);
com.afm->message("atn0430",
AIR_MSG_CHR,"part",com.part_name,
AIR_MSG_CHR,"arch",com.arch_name,
AIR_MSG_CHR,"path",com.in_path_name,
AIR_MSG_END);
rcode = -1;
goto exit_func;
break;
}
rc = com.arch->get_info(AIR_KEY_N_BLOCK,com.num_block);
rc = com.arch->get_info(AIR_KEY_N_IOBLOCK,com.num_io_block);
rc = com.arch->get_info(AIR_KEY_N_COMPONENT,com.num_comp);
rc = com.arch->get_info(AIR_KEY_N_COMPONENTPORT,com.num_cport);
rc = com.arch->get_info(AIR_KEY_N_PORT,com.num_port);
rc = com.arch->get_info(AIR_KEY_N_NET,com.num_net);
exit_func:
return rcode;
}