Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1768


Ignore:
Timestamp:
Sep 11, 2008, 4:40:01 PM (16 years ago)
Author:
rgrieder
Message:

gcc test commit again

Location:
code/branches/core3/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/orxonox/Orxonox.cc

    r1766 r1768  
    8989    static bool convert(orxonox::Radian* output, const char* input)
    9090    {
     91        //std::string asdf("asfd");
     92        //std::cout << asdf;
    9193        float temp;
    9294        convertValue(&temp, input);
     
    9496    }
    9597};
     98
     99class FooBar { };
    96100
    97101
     
    217221    //convertValue(&str, 4.0f);
    218222
    219 
    220     using ::operator<<;
     223    //using ::operator<<;
    221224    using std::string;
    222225    int a = 3;
    223     Radian asdf;
    224     COUT(3) << asdf;
     226    FooBar asdf;
     227    std::string asdf2;
     228    std::cout << asdf2;
     229    ConvertValue(&asdf2, asdf);
     230    //COUT(3) << asdf;
    225231
    226232    TestConv(1, int, (3), float, 3.0);
     
    232238    TestConv(7, const char*, ("4.3"), float, 4.3f);
    233239    TestConv(8, const char*, ("4,3"), Vector2, Vector2(4,3));
    234     TestConv(9, const char*, ("4.4"), Radian, Radian(4.4));
     240    //TestConv(9, const char*, ("4.4"), Radian, Radian(4.4));
    235241    TestConv(100, int, (3), const char*, "3");
    236242    TestConv(101, Vector3, (1, 2, 3), float, 3.0);
  • code/branches/core3/src/util/ArgReader.cc

    r1766 r1768  
    8282  CmdLineArg arg;
    8383
    84   int a = ImplicitConversion<FooBar, const char*>::exists;
     84  //std::cout << errorString_;
     85
     86  int a = conversionTests::ImplicitConversion<FooBar, const char*>::exists;
    8587  int val1;
    8688  long long val2 = conversion_cast<long long>(val1);
  • code/branches/core3/src/util/Convert.h

    r1766 r1768  
    5050#endif
    5151
    52 ///////////////////////////////////
    53 // Explicit Conversion Functions //
    54 ///////////////////////////////////
    55 
    56 
    5752///////////////////////////////////////////////
    5853// Static detection for conversion functions //
     
    9691            return *(new conversionTests::VeryBigStruct());
    9792    }
    98 }
    99 
    100 namespace conversionTests
    101 {
    102     // Part of the msvc hack. See above in the namespace for more explanations.
    103     using namespace separate_namespace;
    10493
    10594    // These operators simply accept anything but have lower priority than specialisations
     
    111100    template <class Any>
    112101    conversionTests::VeryBigStruct operator>>(std::istream& instream,  const Any anything);
     102}
     103
     104namespace conversionTests
     105{
     106    // Part of the msvc hack. See above in the namespace for more explanations.
     107    using namespace separate_namespace;
    113108
    114109    template <class FromType, class ToType>
     
    144139    {
    145140        IStringStreamOperator(); IStringStreamOperator(const IStringStreamOperator&); ~IStringStreamOperator();
    146         static std::istringstream istream_; // helper object to perform the '>>' operation
     141        static std::istream istream_; // helper object to perform the '>>' operation
    147142        static Type object;                 // helper object to handle private c'tor and d'tor
    148143    public:
     
    154149    {
    155150        OStringStreamOperator(); OStringStreamOperator(const OStringStreamOperator&); ~OStringStreamOperator();
    156         static std::ostringstream ostream_; // helper object to perform the '<<' operation
     151        static std::ostream ostream_; // helper object to perform the '<<' operation
    157152        static Type object;                 // helper object to handle private c'tor and d'tor
    158153    public:
     
    169164    Usage: ImplicitConversion<FromType, ToType>::exists
    170165*/
    171 template <class FromType, class ToType>
    172 struct ImplicitConversion
    173 { enum { exists = conversionTests::ImplicitConversion<FromType, ToType>::exists }; };
     166//template <class FromType, class ToType>
     167//struct ImplicitConversion
     168//{ enum { exists = conversionTests::asdf::ImplicitConversion<FromType, ToType>::exists }; };
    174169
    175170/**
     
    179174    Usage: ExplicitConversion<FromType, ToType>::exists
    180175*/
    181 template <class FromType, class ToType>
    182 struct ExplicitConversion
    183 { enum { exists = conversionTests::ExplicitConversion<FromType, ToType>::exists }; };
     176//template <class FromType, class ToType>
     177//struct ExplicitConversion
     178//{ enum { exists = conversionTests::asdf::ExplicitConversion<FromType, ToType>::exists }; };
    184179
    185180/**
     
    189184    Usage: IStringStreamConversion<FromType, ToType>::exists
    190185*/
    191 template <class Type>
    192 struct IStringStreamOperator
    193 { enum { exists = conversionTests::IStringStreamOperator<Type>::exists }; };
     186//template <class Type>
     187//struct IStringStreamOperator
     188//{ enum { exists = conversionTests::asdf::IStringStreamOperator<Type>::exists }; };
    194189
    195190/**
     
    199194    Usage: OStringStreamConversion<FromType, ToType>::exists
    200195*/
    201 template <class Type>
    202 struct OStringStreamOperator
    203 { enum { exists = conversionTests::OStringStreamOperator<Type>::exists }; };
     196//template <class Type>
     197//struct OStringStreamOperator
     198//{ enum { exists = conversionTests::asdf::OStringStreamOperator<Type>::exists }; };
    204199
    205200
     
    286281        static bool convert(std::string* output, const FromType& input)
    287282        {
    288             const bool probe = OStringStreamOperator<FromType>::exists;
     283            const bool probe = conversionTests::OStringStreamOperator<FromType>::exists;
    289284            return convert(output, input, StringStreamPossible<probe>());
    290285        }
     
    328323        static bool convert(ToType* output, const std::string& input)
    329324        {
    330             const bool probe = IStringStreamOperator<ToType>::exists;
     325            const bool probe = conversionTests::IStringStreamOperator<ToType>::exists;
    331326            return convert(output, input, StringStreamPossible<probe>());
    332327        }
     
    381376    inline bool convert(ToType* output, const FromType& input, ExplicitPossible<false>)
    382377    {
    383         const bool probe = ImplicitConversion<FromType, ToType>::exists;
     378        const bool probe = conversionTests::ImplicitConversion<FromType, ToType>::exists;
    384379        return convert(output, input, ImplicitPossible<probe>());
    385380    }
     
    398393    {
    399394        // check for explicit conversion via function overloading
    400         const bool probe = ExplicitConversion<FromType, ToType>::exists;
     395        const bool probe = conversionTests::ExplicitConversion<FromType, ToType>::exists;
    401396        return conversion::convert(output, input, conversion::ExplicitPossible<probe>());
    402397    }
  • code/branches/core3/src/util/Math.h

    r1766 r1768  
    7070
    7171// Vector2 to std::string
    72 inline bool explicitConversion(std::string* output, const orxonox::Vector2& input)
    73 {
    74     std::ostringstream ostream;
    75     if (ostream << input.x << "," << input.y)
    76     {
    77         (*output) = ostream.str();
    78         return true;
    79     }
    80     return false;
    81 }
     72//inline bool explicitConversion(std::string* output, const orxonox::Vector2& input)
     73//{
     74//    std::ostringstream ostream;
     75//    if (ostream << input.x << "," << input.y)
     76//    {
     77//        (*output) = ostream.str();
     78//        return true;
     79//    }
     80//    return false;
     81//}
    8282
    8383// Vector3 to std::string
  • code/branches/core3/src/util/MultiType.h

    r1729 r1768  
    129129
    130130        virtual void toString(std::ostream& outstream) const = 0;
     131        //virtual void toString(std::ostream& outstream) const = 0;
     132        //inline friend virtual std::ostream& operator <<(std::ostream& outstream, const MT_ValueBase& mtb);
    131133
    132134        MT_Type type_;
     
    238240        template <class T> operator T*() const { return ((T*)this->operator void*()); }
    239241
     242        inline friend std::ostream& operator<<(std::ostream& outstream, const MultiType& mt) { if (mt.value_) { mt.value_->toString(outstream); } return outstream; }
     243
    240244        inline void getValue(char*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
    241245        inline void getValue(unsigned char*        value) const { if (this->value_) { (*value) = (*this->value_); } }
     
    318322};
    319323
    320 _UtilExport inline std::ostream& operator<<(std::ostream& outstream, const MultiType& mt) { if (mt.value_) { mt.value_->toString(outstream); } return outstream; }
     324//_UtilExport inline std::ostream& operator<<(std::ostream& outstream, const MultiType& mt) { if (mt.value_) { mt.value_->toString(outstream); } return outstream; }
    321325
    322326template <> inline bool MultiType::isType<char>()                 const { return (this->value_ && this->value_->type_ == MT_char);        }
  • code/branches/core3/src/util/MultiTypeValue.h

    r1727 r1768  
    9191    inline operator orxonox::Degree()      const { return getConvertedValue<T, orxonox::Degree>     (this->value_); }
    9292
    93     inline void toString(std::ostream& outstream) const { outstream << this->value_; }
     93    inline void toString(std::ostream& outstream) const { std::operator <<(outstream, conversion_cast<std::string>(this->value_)); }
     94    //inline friend std::ostream& operator <<(std::ostream& outstream, const MT_Value& mtv) { outstream << conversion_cast<std::string>(this->value_); return outsream; }
    9495
    9596    T value_;
Note: See TracChangeset for help on using the changeset viewer.