diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-02-15 20:43:48 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-02-15 20:43:48 +0000 |
commit | b204839da1d9e2c824f154bafe512d3abda8e484 (patch) | |
tree | c0b306cd78d333e3d49d86d6bf933845df725a7e | |
parent | 9a021e53288fce19716b7e9c1e872a70947b2b47 (diff) | |
download | ATCD-b204839da1d9e2c824f154bafe512d3abda8e484.tar.gz |
Tue Feb 15 20:38:41 2005 Will Otte <wotte@dre.vanderbilt.edu>
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp | 69 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h | 34 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp | 12 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h | 3 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc | 12 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp | 64 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h | 2 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp | 2 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.cpp | 70 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.h | 74 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp | 7 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h | 4 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp | 42 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h | 13 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/test.cpp | 70 |
15 files changed, 338 insertions, 140 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp index b148f97c25d..73e6d77d313 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.cpp @@ -14,9 +14,8 @@ namespace CIAO { namespace Config_Handlers { - ADD_Handler::IDREF_MAP idref_map_ (); - ADD_Handler::POS_MAP pos_map_ (); - + IDREF_Base ADD_Handler::IDREF; + bool ADD_Handler::artifact_deployment_descrs ( const DeploymentPlan &src, @@ -114,13 +113,21 @@ namespace CIAO if (src.id_p ()) { ACE_CString cstr (src.id ().c_str ()); - - bool retval = bind_ref (cstr,pos); + + bool retval = ADD_Handler::IDREF.bind_ref (cstr,pos); if (!retval) { return false; } } + else + { + ACE_DEBUG ((LM_ERROR, + "(%P|%t) Warning: ADD %s has no idref.\n", + src.name ().c_str ())); + } + + #if 0 // @@ MAJO: Don't know how to handle this. if (src.deployRequirement_p ()) @@ -181,58 +188,6 @@ namespace CIAO return add; } - - bool - ADD_Handler::bind_ref (ACE_CString& id, size_t index) - { - int retval = - idref_map_->bind (id, index); - - pos_map_->bind (index,id); - - if (retval < 0) - return false; - - return true; - } - - bool - ADD_Handler::find_ref (const ACE_CString& id, size_t val) - { - int retval = - idref_map_->find (id, val); - - if (retval < 0) - return false; - - return true; - } - - bool - ADD_Handler::find_ref (const size_t id, ACE_CString& val) - { - int retval = - pos_map_->find (id,val); - - if (retval < 0) - return false; - - return true; - } - - bool - ADD_Handler::unbind_refs (void) - { - int retval = - idref_map_->unbind_all (); - - pos_map_->unbind_all (); - - if (retval < 0) - return false; - - return true; - } } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h index 301e680c073..a56d0143be8 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/ADD_Handler.h @@ -14,9 +14,7 @@ #include "Config_Handlers/Config_Handlers_Export.h" #include "tao/Basic_Types.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/Null_Mutex.h" -#include "ace/Singleton.h" +#include "IDREF_Base.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -59,40 +57,14 @@ namespace CIAO artifact_deployment_descr ( const Deployment::ArtifactDeploymentDescription &src); + /// The IDREF Table associated with this class + static IDREF_Base IDREF; - static bool - bind_ref (ACE_CString& id, size_t index); - - static bool - find_ref (const ACE_CString& id, size_t val); - - static bool - find_ref (const size_t id, ACE_CString& val); - - static bool - unbind_refs (void); - - typedef ACE_Hash_Map_Manager<ACE_CString, - size_t, - ACE_Null_Mutex> IDREF_MAP; - - - typedef ACE_Hash_Map_Manager<size_t, - ACE_CString, - ACE_Null_Mutex> POS_MAP; - private: static bool artifact_deployment_descr ( const ArtifactDeploymentDescription& desc, ::Deployment::ArtifactDeploymentDescription &dest, CORBA::ULong l = 0); - - /// The map used to store and look up the indexes of elements - /// referenced by their IDREF. - static IDREF_MAP idref_map_; - /// The map used to store and look up the IDREFS of elements - /// referenced by their index. - static POS_MAP pos_map_; }; } } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp index 3726bb8fcf9..0e993106f3f 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.cpp @@ -36,38 +36,45 @@ namespace CIAO { toconfig <<= static_cast<CORBA::UShort> (value.ushort ()); + } else if (value.long_p ()) { toconfig <<= static_cast <CORBA::Long> (value.long_ ()); + } else if (value.ulong_p ()) { CORBA::ULong val = value.ulong (); toconfig <<= val; + } else if (value.boolean_p ()) { CORBA::Boolean val = value.boolean (); toconfig <<= val; + } else if (value.double_p ()) { CORBA::Boolean val = value.double_ (); toconfig <<= val; + } else if (value.float_p ()) { CORBA::Float val = value.float_ (); toconfig <<= val; + } else if (value.string_p ()) { toconfig <<= value.string ().c_str (); + } else if (value.octet_p ()) { @@ -75,21 +82,24 @@ namespace CIAO toconfig <<= CORBA::Any::from_octet (val); + } else if (value.longlong_p ()) { CORBA::LongLong val = value.longlong (); toconfig <<= val; + } else if (value.ulonglong_p ()) { CORBA::ULongLong val = value.ulonglong (); toconfig <<=val; + } } - Any get_any (const ::CORBA::Any& src) + Any Any_Handler::get_any (const ::CORBA::Any& src) { //MAJO //@Bala ... still haven't figured this one out yet diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h index 3de517147c3..8317c41422f 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Any_Handler.h @@ -47,7 +47,8 @@ namespace CIAO static void extract_into_any (const Any& desc, ::CORBA::Any& toconfig); - static Any get_any (const ::CORBA::Any& src); + + static Any get_any (const CORBA::Any &src); }; } } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc index 57adfc63632..ac807acfd52 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc +++ b/TAO/CIAO/DAnCE/Config_Handlers/Config_Handlers.mpc @@ -1,14 +1,15 @@ //$Id$ -project (Config_Handlers) : ciao_deployment_stub { - sharedname = Config_Handlers +project (Config_Handlers) : acelib, ciao_deployment_stub { + sharedname = XSC_Config_Handlers dynamicflags = CONFIG_HANDLERS_BUILD_DLL macros += XML_USE_PTHREADS requires += exceptions includes += $(XERCESCROOT)/include . libpaths += $(XERCESCROOT)/lib libs += xerces-c - + includes += $(CIAO_ROOT)/DAnCE/Config_Handlers + Source_Files { ccd.cpp cdd.cpp @@ -48,6 +49,7 @@ project (Config_Handlers) : ciao_deployment_stub { XML_Error_Handler.cpp XML_Helper.cpp XML_File_Intf.cpp + IDREF_Base.cpp } Header_Files { @@ -66,7 +68,11 @@ project (XSC_Config_Handlers_Tests) : ciao_deployment_stub { Source_Files { test.cpp + DnC_Dump.cpp + DnC_Dump_T.cpp + Dump_Obj.cpp } + } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp index 1e8a7997a0d..fc7df2d8188 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.cpp @@ -5,9 +5,12 @@ #include "ADD_Handler.h" #include "MDD_Handler.h" #include "IDD_Handler.h" +#include "ID_Handler.h" #include "cdp.hpp" #include "Singleton_IDREF_Map.h" +#include "DP_PCD_Handler.h" + ACE_RCSID (Config_Handlers, DP_Handler, "$Id$") @@ -77,23 +80,8 @@ namespace CIAO CORBA::string_dup (this->dp_.UUID ().c_str ()); } - // Get the connection info from the PCD_Handler. - // This looks different from the others because PCD_Handler only offers - // a void function. - for (DeploymentPlan::connection_const_iterator cstart = this->dp_.begin_connection (); - cstart != this->dp_.end_connection (); - ++cstart) - { - // where does this length () method come from?? - CORBA::ULong len = - this->idl_dp_->connection.length (); - - this->idl_dp_->connection.length (len + 1); - PCD_Handler::get_PlanConnection_Description ( - *cstart, - this->idl_dp_->connection [len]); - } + DP_PCD_Handler::plan_connection_descrs (this->dp_, this->idl_dp_->connection); // Similar thing for dependsOn for (DeploymentPlan::dependsOn_const_iterator dstart = this->dp_.begin_dependsOn (); @@ -105,10 +93,13 @@ namespace CIAO this->idl_dp_->dependsOn.length (len + 1); - ID_Handler::getImplementationDependency ( - *cstart, - this->idl_dp_->dependsOn [len]); + ID_Handler::get_ImplementationDependency ( + this->idl_dp_->dependsOn [len], + *dstart); + } + + /* @@ Not needed at this time... // ... and the property stuff for (DeploymentPlan::infoProperty_const_iterator pstart = this->dp_.begin_infoProperty (); @@ -124,7 +115,7 @@ namespace CIAO *pstart, this->idl_dp_->infoProperty [len]); } - + */ // ************************* // Steve's stuff ends here // ************************* @@ -135,7 +126,13 @@ namespace CIAO this->idl_dp_->realizes); if (!this->retval_) - return this->retval_; + { + ACE_DEBUG ((LM_ERROR, + "(%P|%t) DP_Handler: " + "Error parting Component Interface Descriptor.")); + return false; + } + this->retval_ = ADD_Handler::artifact_deployment_descrs ( @@ -143,23 +140,38 @@ namespace CIAO this->idl_dp_->artifact); if (!this->retval_) - return this->retval_; + { + ACE_DEBUG ((LM_ERROR, + "(%P|%t) DP_Handler: " + "Error parting Artifact Deployment Descriptior.")); + return false; + } this->retval_ = MDD_Handler::mono_deployment_descriptions ( - this->dp_.implementation (), + this->dp_, this->idl_dp_->implementation); if (!this->retval_) - return this->retval_; - + { + ACE_DEBUG ((LM_ERROR, + "(%P|%t) DP_Handler: " + "Error parting Monolithic Deployment Decriptions.")); + return false; + } + this->retval_ = IDD_Handler::instance_deployment_descrs ( this->dp_, this->idl_dp_->instance); if (!this->retval_) - return this->retval_; + { + ACE_DEBUG ((LM_ERROR, + "(%P|%t) DP_Handler: " + "Error parting Instance Deployment Decriptions.")); + return false; + } return this->retval_; } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h index 9967070ad67..08da1a611c2 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/DP_Handler.h @@ -12,7 +12,7 @@ #define CIAO_CONFIG_HANDLERS_DP_HANDLER_H #include /**/ "ace/pre.h" -#include "Config_Handlers/Config_Handlers_Export.h" +#include "Config_Handlers_Export.h" #include "ace/Auto_Ptr.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp index 9dc9e5b9836..54bd542cb19 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/IDD_Handler.cpp @@ -77,6 +77,7 @@ namespace CIAO dest.configProperty[len]); } +#if 0 /* MAJO: Handle this next round */ InstanceDeploymentDescription::deployedResource_const_iterator drend = src.end_deployedResource (); @@ -96,6 +97,7 @@ namespace CIAO } +#endif #if 0 // @@ MAJO: Need to handle this in the next round if (desc.deployedSharedResource_p ()) diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.cpp b/TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.cpp new file mode 100644 index 00000000000..0021c5341a4 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.cpp @@ -0,0 +1,70 @@ +// $Id$ + +#include "IDREF_Base.h" + + +ACE_RCSID (DAnCE, + IDREF_Base, + "$Id$") + + +namespace CIAO +{ + namespace Config_Handlers + { + + bool + IDREF_Base::bind_ref (ACE_CString& id, size_t index) + { + int retval = + idref_map_.bind (id, index); + + pos_map_.bind (index,id); + + if (retval < 0) + return false; + + return true; + } + + bool + IDREF_Base::find_ref (const ACE_CString& id, size_t val) + { + int retval = + idref_map_.find (id, val); + + if (retval < 0) + return false; + + return true; + } + + bool + IDREF_Base::find_ref (const size_t id, ACE_CString& val) + { + int retval = + pos_map_.find (id,val); + + if (retval < 0) + return false; + + return true; + } + + bool + IDREF_Base::unbind_refs (void) + { + int retval = + idref_map_.unbind_all (); + + pos_map_.unbind_all (); + + if (retval < 0) + return false; + + return true; + } +} + +} + diff --git a/TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.h b/TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.h new file mode 100644 index 00000000000..0379083f3f2 --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/IDREF_Base.h @@ -0,0 +1,74 @@ +/** + * $Id$ + * @file IDREF_Base.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + * + * Defines the IDREF_Base class, which is an abstract class that serves + * as a base for any config handler that must map IDREFS. + */ + +#ifndef CIAO_CONFIG_HANDLERS_IDREF_BASE_H +#define CIAO_CONFIG_HANDLERS_IDREF_BASE_H + +#include /**/ "ace/pre.h" +#include "Config_Handlers_Export.h" +#include "ace/Hash_Map_Manager.h" +#include "ace/Null_Mutex.h" +#include "ace/String_Base.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Config_Handlers + { + + /** + * @class IDREF_Handler + * @brief Base class for any handler that must process idrefs. + * + */ + class Config_Handlers_Export IDREF_Base + { + public: + /// Bind an IDREF to an index + bool + bind_ref (ACE_CString& id, size_t index); + + /// Get the index associated with an IDREF + bool + find_ref (const ACE_CString& id, size_t val); + + /// get the IDREF associated with an index + bool + find_ref (const size_t id, ACE_CString& val); + + /// Unbind all IDREFS + bool + unbind_refs (void); + + typedef ACE_Hash_Map_Manager<ACE_CString, + size_t, + ACE_Null_Mutex> IDREF_MAP; + + + typedef ACE_Hash_Map_Manager<size_t, + ACE_CString, + ACE_Null_Mutex> POS_MAP; + protected: + /// The map used to store and look up the indexes of elements + /// referenced by their IDREF. + IDREF_MAP idref_map_; + /// The map used to store and look up the IDREFS of elements + /// referenced by their index. + POS_MAP pos_map_; + }; + + } + +} + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_HANDLERS_IDREF_BASE_H */ diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp index d563dc8b3d1..664e4f46b3d 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.cpp @@ -21,15 +21,10 @@ namespace CIAO void ID_Handler::get_ImplementationDependency ( Deployment::ImplementationDependency& toconfig, - ImplementationDependency& desc) + const ImplementationDependency& desc) { - - - toconfig.requiredType= CORBA::string_dup (desc.requiredType ().c_str ()); - - } ImplementationDependency diff --git a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h index 9e721d8d42a..84923db4418 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/ID_Handler.h @@ -54,9 +54,9 @@ namespace CIAO ID_Handler (void); virtual ~ID_Handler (void); - void get_ImplementationDependency ( + static void get_ImplementationDependency ( Deployment::ImplementationDependency& toconfig, - ImplementationDependency& desc); + const ImplementationDependency& desc); ImplementationDependency impl_dependency ( const ::Deployment::ImplementationDependency& src); diff --git a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp index c4b426a284d..4994e874968 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.cpp @@ -5,15 +5,17 @@ #include "ADD_Handler.h" #include "Property_Handler.h" #include "Req_Handler.h" -#include "Singleton_IDREF_Map.h" +#include "cdp.hpp" namespace CIAO { namespace Config_Handlers { + IDREF_Base MDD_Handler::IDREF; + bool MDD_Handler::mono_deployment_descriptions ( - const MonolithicDeploymentDescription& src, + const DeploymentPlan& src, Deployment::MonolithicDeploymentDescriptions& dest) { /* @@ This has changed. The schema has maxoccurred = unbounded */ @@ -34,9 +36,16 @@ namespace CIAO dest.length (len + 1); bool retval = MDD_Handler::mono_deployment_description (*imp_b, - dest[len]); + dest[len], + len); if (!retval) - return false; + { + ACE_DEBUG ((LM_ERROR, + "(%P|%t) MDD_Handler: Error parsing element %i\n", + len)); + return false; + } + } return true; } @@ -44,7 +53,8 @@ namespace CIAO bool MDD_Handler::mono_deployment_description ( const MonolithicDeploymentDescription& desc, - Deployment::MonolithicDeploymentDescription& toconfig) + Deployment::MonolithicDeploymentDescription& toconfig, + CORBA::ULong pos) { toconfig.name = CORBA::string_dup (desc.name ().c_str ()); @@ -77,13 +87,14 @@ namespace CIAO CORBA::ULong tmp = 0; bool r = - Singleton_IDREF_Map::instance ()->find_ref ( - ab->id ().c_str (), - tmp); + ADD_Handler::IDREF.find_ref (ab->id ().c_str (), + tmp); if (!r) { // @@MAJO: What should we do if find_ref fails? + ACE_DEBUG ((LM_ERROR, + "(%P|%t) MDD_Handler: Find ref failed! Uh oh!\n")); return false; } @@ -125,6 +136,21 @@ namespace CIAO } #endif /*if 0*/ + // Handle the idref + if (desc.id_p ()) + { + ACE_CString cstr (desc.id ().c_str ()); + + if (!MDD_Handler::IDREF.bind_ref (cstr, pos)) + return false; + } + else + { + ACE_DEBUG((LM_ERROR, + "(%P|%t) Warning: MDD %s has no idref \n", + desc.name ().c_str ())); + } + return true; } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h index c094c8c45f2..7ad554ac859 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/MDD_Handler.h @@ -11,8 +11,9 @@ #ifndef CIAO_CONFIG_HANDLERS_MDD_Handler_H #define CIAO_CONFIG_HANDLERS_MDD_Handler_H #include /**/ "ace/pre.h" - +#include "tao/Basic_Types.h" #include "Config_Handlers_Export.h" +#include "IDREF_Base.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -32,7 +33,8 @@ namespace CIAO namespace Config_Handlers { class MonolithicDeploymentDescription; - + class DeploymentPlan; + /* * @class MDD_Handler * @@ -48,13 +50,16 @@ namespace CIAO { public: static bool mono_deployment_descriptions ( - const MonolithicDeploymentDescription& src, + const DeploymentPlan &src, Deployment::MonolithicDeploymentDescriptions &dest); + static IDREF_Base IDREF; + private: static bool mono_deployment_description ( const MonolithicDeploymentDescription& desc, - Deployment::MonolithicDeploymentDescription& toconfig); + Deployment::MonolithicDeploymentDescription& toconfig, + CORBA::ULong pos); }; } } diff --git a/TAO/CIAO/DAnCE/Config_Handlers/test.cpp b/TAO/CIAO/DAnCE/Config_Handlers/test.cpp new file mode 100644 index 00000000000..416f7ab558e --- /dev/null +++ b/TAO/CIAO/DAnCE/Config_Handlers/test.cpp @@ -0,0 +1,70 @@ +// $Id$ +#include <iostream> + +#include "Deployment.hpp" +#include "DP_Handler.h" +#include "ciao/Deployment_DataC.h" +#include "ace/Get_Opt.h" +#include "XML_Helper.h" +#include "DnC_Dump.h" +#include "tao/ORB.h" +static const char *input_file = "test.xml"; + + +static int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "i:"); + + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'i': + input_file = get_opts.opt_arg (); + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-i <input file> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command-line + return 0; +} + +using namespace CIAO::Config_Handlers; + + +int main (int argc, char *argv[]) +{ + + if (parse_args (argc, argv) != 0) + return 1; + + // Initialize an ORB so Any will work + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, ""); + + XML_Helper the_helper; + + if (xercesc::DOMDocument *doc = the_helper.create_dom (input_file)) + { + DeploymentPlan dp = deploymentPlan (doc); + + + DP_Handler dp_handler (dp); + + std::cout << "Instance document import succeeded. Dumping contents....\n"; + + Deployment::DnC_Dump::dump (*dp_handler.plan ()); + + } + + std::cout << "Test completed!\n"; +} + + |