diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2004-09-22 20:26:43 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2004-09-22 20:26:43 +0000 |
commit | 4575aded9abae73ae8b5ad6afbabd9335a945589 (patch) | |
tree | 1355e9b34f3f6b598bfbe02ec0f0799dce64d632 | |
parent | f13c5259e0d5a8acc2096b3a9741bb5b379a2065 (diff) | |
download | ATCD-4575aded9abae73ae8b5ad6afbabd9335a945589.tar.gz |
Wed Sep 22 15:25:33 2004 Will Otte <wotte@dre.vanderbilt.edu>
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.cpp | 24 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.h | 66 |
2 files changed, 63 insertions, 27 deletions
diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.cpp b/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.cpp index 268334452f3..3ab3d1bd6f8 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.cpp +++ b/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.cpp @@ -1,7 +1,8 @@ // $Id$ #include "Base_Handler.h" - +#include "tao/CORBA_String.h" +#include "tao/StringSeqC.h" namespace CIAO { @@ -15,6 +16,27 @@ namespace CIAO Base_Handler::~Base_Handler (void) { } + + // This should probably be inline. + // Copies the string provided into the provided CORBA string. + void + Base_Handler::handle_string (const ::XMLSchema::string <char> &str, + CORBA::String_var &tofill) + { + tofill = CORBA::string_dup (str.c_str ()); + } + + + /// Appends the string provided to the provided StringSeq. + void + Base_Handler::handle_string_seq (::XMLSchema::string <char> &str, + CORBA::StringSeq &tofill) + { + tofill.length (tofill.length () + 1); + tofill[tofill.length () - 1] = + CORBA::string_dup (str.c_str ()); + } + /// The Deployment spec references elements by /// their position within their parent sequence. diff --git a/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.h b/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.h index 8736edec106..4d8d05fb09d 100644 --- a/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.h +++ b/TAO/CIAO/DAnCE/Config_Handlers/Base_Handler.h @@ -21,47 +21,61 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +namespace CORBA +{ + struct String_var; + struct StringSeq; +} + namespace CIAO { namespace Config_Handlers { - /* - * @class Base_Handler - * - * @brief base class for Type handlers. - * - * - * - */ + /* + * @class Base_Handler + * + * @brief base class for Type handlers. + * + * + * + */ class Config_Handlers_Export Base_Handler{ - public: + public: - typedef ACE_Hash_Map_Manager<ACE_TString, size_t, ACE_Null_Mutex> IDREF_MAP; + typedef ACE_Hash_Map_Manager<ACE_TString, size_t, ACE_Null_Mutex> IDREF_MAP; - Base_Handler (void); - virtual ~Base_Handler (void); - - /// The Deployment spec references elements by - /// their position within their parent sequence. - /// These two methods allow an element's index - /// to be stored/retrieved. + Base_Handler (void); + virtual ~Base_Handler (void); + + /// Populates a CORBA string with the provided XMLString. + void handle_string (const ::XMLSchema::string <char> &str, + CORBA::String_var &tofill); + + /// Appends the string provided to the provided StringSeq. + void handle_string_seq (::XMLSchema::string <char> &str, + CORBA::StringSeq &tofill); + + /// The Deployment spec references elements by + /// their position within their parent sequence. + /// These two methods allow an element's index + /// to be stored/retrieved. - /// Map the index <index> of an element to its IDREF <id>. - void bind_ref (ACE_TString& id, size_t index); + /// Map the index <index> of an element to its IDREF <id>. + void bind_ref (ACE_TString& id, size_t index); - /// Retrieve the index of an element with its IDREF <id>. - /// Returns 0 if the <id> was found. - int get_ref (ACE_TString& id, size_t val); + /// Retrieve the index of an element with its IDREF <id>. + /// Returns 0 if the <id> was found. + int get_ref (ACE_TString& id, size_t val); - private: + private: - /// The map used to store and look up the indexes - /// of elements referenced by their index. - IDREF_MAP idref_map_; + /// The map used to store and look up the indexes + /// of elements referenced by their index. + IDREF_MAP idref_map_; }; } |