diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp | |
parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
download | ATCD-DS-main.tar.gz |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp')
-rw-r--r-- | modules/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/modules/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp b/modules/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp new file mode 100644 index 00000000000..e265295d040 --- /dev/null +++ b/modules/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp @@ -0,0 +1,75 @@ +// $Id$ + +#include "STD_PC_Intf.h" +#include "Utils/XML_Helper.h" +#include "Deployment.hpp" +#include "STD_PCD_Handler.h" +#include "ciao/Packaging_DataC.h" +#include "ciao/CIAO_common.h" + +namespace CIAO +{ + namespace Config_Handlers + { + STD_PC_Intf::STD_PC_Intf (const char *file) + { + if (!this->prepare_PC (file)) + throw; + } + + bool + STD_PC_Intf::prepare_PC (const char *file) + { + CIAO_TRACE("STD_PC_Intf::prepare_PC"); + + ACE_Auto_Ptr<XML_Helper> helper (new XML_Helper); + + if (!helper->is_initialized ()) + return false; + + // parse the .pcd (PackageConfigurationDescription) file + xercesc::DOMDocument *dom = + helper->create_dom (file); + + if (!dom) + return false; + + + PackageConfiguration pc = + packageConfiguration (dom); + + + Deployment::PackageConfiguration idl_pc; + + + STD_PCD_Handler pcd_handler (helper.get ()); + + pcd_handler.package_config (pc, + idl_pc); + + + Deployment::PackageConfiguration *p_idl_pc = + new Deployment::PackageConfiguration (idl_pc); + + // let ACE_Auto_Ptr take over + this->idl_pc_.reset (p_idl_pc); + + if (this->idl_pc_.get ()) + return true; + + return false; + } + + ::Deployment::PackageConfiguration const * + STD_PC_Intf::get_PC (void) const + { + return this->idl_pc_.get (); + } + + ::Deployment::PackageConfiguration * + STD_PC_Intf::get_PC (void) + { + return this->idl_pc_.release (); + } + } +} |