Commit 9bb5f9de0ba81fdab2aaf89f6559ec330a2b4514
1 parent
a98595a3
removed unique name methods
Showing
2 changed files
with
0 additions
and
42 deletions
include/GModelSpatialComposite.hpp
| ... | ... | @@ -88,8 +88,6 @@ protected: |
| 88 | 88 | void init_members(void); |
| 89 | 89 | void copy_members(const GModelSpatialComposite& model); |
| 90 | 90 | void free_members(void); |
| 91 | - std::string unique_component_name(void); | |
| 92 | - bool component_name_is_unique(std::string name) const; | |
| 93 | 91 | |
| 94 | 92 | // Protected members |
| 95 | 93 | std::string m_type; //!< Model type | ... | ... |
src/model/GModelSpatialComposite.cpp
| ... | ... | @@ -698,43 +698,3 @@ void GModelSpatialComposite::free_members(void) |
| 698 | 698 | // Return |
| 699 | 699 | return; |
| 700 | 700 | } |
| 701 | - | |
| 702 | - | |
| 703 | -/***********************************************************************//** | |
| 704 | - * @brief Returns an unused name for a model component | |
| 705 | - * | |
| 706 | - * @return Model name | |
| 707 | - ***************************************************************************/ | |
| 708 | -std::string GModelSpatialComposite::unique_component_name(void) { | |
| 709 | - unsigned int index = components(); | |
| 710 | - while (1) { | |
| 711 | - // Generate name from name index | |
| 712 | - std::string s = gammalib::str(index++); | |
| 713 | - | |
| 714 | - // Check if name is unique | |
| 715 | - if (component_name_is_unique(s)) { | |
| 716 | - // Return | |
| 717 | - return s; | |
| 718 | - } | |
| 719 | - } | |
| 720 | -} | |
| 721 | - | |
| 722 | -/***********************************************************************//** | |
| 723 | - * @brief Checks if @p name is not used in component names | |
| 724 | - * | |
| 725 | - * @param[in] name Name to check | |
| 726 | - * | |
| 727 | - * @return name unique? | |
| 728 | - ***************************************************************************/ | |
| 729 | -bool GModelSpatialComposite::component_name_is_unique(std::string name) const { | |
| 730 | - | |
| 731 | - // Check if name is unique | |
| 732 | - bool is_unique = true; | |
| 733 | - for (unsigned int i = 0; i < m_component_names.size(); i++) { | |
| 734 | - if (name == m_component_names[i]) { | |
| 735 | - is_unique = false; | |
| 736 | - break; | |
| 737 | - } | |
| 738 | - } | |
| 739 | - return is_unique; | |
| 740 | -} | ... | ... |