Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 6, 2010, 2:35:53 PM (14 years ago)
Author:
rgrieder
Message:

Removed obsolete code from Convert.h and replaced last occurrences of getConvertedValue with just two arguments.

Location:
code/branches/doc/src/libraries
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/src/libraries/core/command/TclThreadManager.cc

    r7361 r7365  
    256256    void TclThreadManager::initialize(TclInterpreterBundle* bundle)
    257257    {
    258         const std::string& id_string = getConvertedValue<unsigned int, std::string>(bundle->id_);
     258        const std::string& id_string = multi_cast<std::string>(bundle->id_);
    259259
    260260        // Initialize the new interpreter
     
    408408            {
    409409                // This query would lead to a deadlock - return with an error
    410                 TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + getConvertedValue<unsigned int, std::string>(source_bundle->id_) \
    411                             + " -> " + getConvertedValue<unsigned int, std::string>(target_bundle->id_) \
    412                             + "), couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(target_bundle->id_) \
    413                             + " from other interpreter with ID " + getConvertedValue<unsigned int, std::string>(source_bundle->id_) + '.');
     410                TclThreadManager::error("Error: Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
     411                            + " -> " + multi_cast<std::string>(target_bundle->id_) \
     412                            + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) \
     413                            + " from other interpreter with ID " + multi_cast<std::string>(source_bundle->id_) + '.');
    414414            }
    415415            else
     
    477477                    // This happens if the main thread tries to query a busy interpreter
    478478                    // To avoid a lock of the main thread, we simply don't proceed with the query in this case
    479                     TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(target_bundle->id_) + ", interpreter is busy right now.");
     479                    TclThreadManager::error("Error: Couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) + ", interpreter is busy right now.");
    480480                }
    481481            }
     
    523523        else
    524524        {
    525             TclThreadManager::error("Error: No Tcl-interpreter with ID " + getConvertedValue<unsigned int, std::string>(id) + " existing.");
     525            TclThreadManager::error("Error: No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing.");
    526526            return 0;
    527527        }
     
    539539                output += ' ';
    540540
    541             output += getConvertedValue<unsigned int, std::string>(*it);
     541            output += multi_cast<std::string>(*it);
    542542        }
    543543        return output;
     
    591591        if (cc != TCL_OK)
    592592        {
    593             TclThreadManager::error("Tcl error (" + action + ", ID " + getConvertedValue<unsigned int, std::string>(bundle->id_) + "): " + static_cast<std::string>(result));
     593            TclThreadManager::error("Tcl error (" + action + ", ID " + multi_cast<std::string>(bundle->id_) + "): " + static_cast<std::string>(result));
    594594            return "";
    595595        }
  • code/branches/doc/src/libraries/util/Convert.h

    r7364 r7365  
    161161        }
    162162    };
    163 
    164     ////////////
    165     // upcast //
    166     ////////////
    167     namespace detail
    168     {
    169         // perform a static cast if ToType is a base of FromType
    170         template<class ToType, class FromType>
    171         FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<true>)
    172         {
    173             return static_cast<ToType>(input);
    174         }
    175 
    176         // return zero if ToType is not a base of FromType
    177         template<class ToType, class FromType>
    178         FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<false>)
    179         {
    180             return 0;
    181         }
    182     }
    183 
    184     // performs an upcast if ToType is a base of FromType, returns zero otherwise
    185     template <class ToType, class FromType>
    186     FORCEINLINE ToType upcast(FromType input)
    187     {
    188         enum { probe = ImplicitConversion<FromType, ToType>::exists };
    189         return detail::upcast<ToType, FromType>(input, Loki::Int2Type<probe>());
    190     }
    191163}
    192164
     
    381353    }
    382354
    383     template<class FromType, class ToType>
    384     FORCEINLINE ToType getConvertedValue(const FromType& input)
    385     {
    386         ToType output;
    387         convertValue(&output, input);
    388         return output;
    389     }
    390 
    391355    /// Directly returns the converted value, but uses the fallback on failure. @see convertValue
    392356    template<class FromType, class ToType>
     
    443407    /// Conversion would exhibit ambiguous << or >> operators when using iostream
    444408    template <>
    445     template <>
    446409    struct ConverterExplicit<unsigned char, std::string>
    447410    {
     
    453416    };
    454417    /// Conversion would exhibit ambiguous << or >> operators when using iostream
    455     template <>
    456418    template <>
    457419    struct ConverterExplicit<std::string, char>
Note: See TracChangeset for help on using the changeset viewer.