diff options
Diffstat (limited to 'CIAO/DAnCE/Config_Handlers/Property_Handler.cpp')
-rw-r--r-- | CIAO/DAnCE/Config_Handlers/Property_Handler.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp b/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp new file mode 100644 index 00000000000..ab4289637e1 --- /dev/null +++ b/CIAO/DAnCE/Config_Handlers/Property_Handler.cpp @@ -0,0 +1,56 @@ +//$Id$ + +#include "Property_Handler.h" +#include "Any_Handler.h" +#include "Basic_Deployment_Data.hpp" +#include "DAnCE/Deployment/Deployment_DataC.h" +#include "DAnCE/Logger/Log_Macros.h" +namespace CIAO +{ + namespace Config_Handlers + { + + Property_Handler::Property_Handler (void) + { + } + + Property_Handler::~Property_Handler (void) + { + } + + void + Property_Handler::handle_property (const Property& desc, + Deployment::Property& toconfig) + { + DANCE_TRACE("Property_Handler::get_property"); + + try + { + toconfig.name = + CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ())); + + Any_Handler::extract_into_any (desc.value (), + toconfig.value); + } + catch (Config_Error &ex) + { + ex.name_ = desc.name (); + throw ex; + } + } + + Property + Property_Handler::get_property (const Deployment::Property& src) + { + DANCE_TRACE("Property_Handler::get_property - reverse"); + + ::XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR(src.name)); + Any value (Any_Handler::get_any (src.value)); + + Property prop (name,value); + + return prop; + } + + } +} |