From: Braden M. <br...@us...> - 2007-06-06 06:28:27
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14807/src/libopenvrml/openvrml Modified Files: field_value.cpp field_value.h Log Message: Made constructors of mf* types taking a FieldValue::value_type inline. This should facilitate elision of a copy of the argument. Index: field_value.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/field_value.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** field_value.cpp 6 Mar 2007 07:24:01 -0000 1.30 --- field_value.cpp 6 Jun 2007 06:28:27 -0000 1.31 *************** *** 3539,3542 **** --- 3539,3544 ---- /** + * @fn openvrml::mfbool::mfbool(const value_type & value) + * * @brief Construct. * *************** *** 3545,3552 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfbool::mfbool(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 3547,3550 ---- *************** *** 3751,3754 **** --- 3749,3754 ---- /** + * @fn openvrml::mfcolor::mfcolor(const value_type & value) + * * @brief Construct. * *************** *** 3757,3764 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfcolor::mfcolor(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 3757,3760 ---- *************** *** 3962,3965 **** --- 3958,3963 ---- /** + * @fn openvrml::mfcolorrgba::mfcolorrgba(const value_type & value) + * * @brief Construct. * *************** *** 3968,3975 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfcolorrgba::mfcolorrgba(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 3966,3969 ---- *************** *** 4175,4178 **** --- 4169,4174 ---- /** + * @fn openvrml::mffloat::mffloat(const value_type & value) + * * @brief Construct. * *************** *** 4181,4188 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mffloat::mffloat(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 4177,4180 ---- *************** *** 4379,4383 **** */ openvrml::mfdouble::mfdouble(const std::vector<double>::size_type n, ! const double value) OPENVRML_THROW1(std::bad_alloc): field_value(std::vector<double>(n, value), value_type_constructor_tag()) --- 4371,4375 ---- */ openvrml::mfdouble::mfdouble(const std::vector<double>::size_type n, ! const double value) OPENVRML_THROW1(std::bad_alloc): field_value(std::vector<double>(n, value), value_type_constructor_tag()) *************** *** 4385,4388 **** --- 4377,4382 ---- /** + * @fn openvrml::mfdouble::mfdouble(const value_type & value) + * * @brief Construct. * *************** *** 4391,4398 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfdouble::mfdouble(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 4385,4388 ---- *************** *** 4595,4598 **** --- 4585,4590 ---- /** + * @fn openvrml::mfimage::mfimage(const value_type & value) + * * @brief Construct. * *************** *** 4601,4608 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfimage::mfimage(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 4593,4596 ---- *************** *** 4805,4808 **** --- 4793,4798 ---- /** + * @fn openvrml::mfint32::mfint32(const value_type & value) + * * @brief Construct. * *************** *** 4811,4818 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfint32::mfint32(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 4801,4804 ---- *************** *** 5016,5019 **** --- 5002,5007 ---- /** + * @fn openvrml::mfnode::mfnode(const value_type & value) + * * @brief Construct. * *************** *** 5022,5029 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfnode::mfnode(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 5010,5013 ---- *************** *** 5230,5233 **** --- 5214,5219 ---- /** + * @fn openvrml::mfrotation::mfrotation(const value_type & value) + * * @brief Construct. * *************** *** 5236,5243 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfrotation::mfrotation(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 5222,5225 ---- *************** *** 5426,5430 **** * @brief Construct. * ! * Creates an <code>mfstring</code> with @p n copies of @p value. * * @param[in] n the number elements in @a mfstring::value. --- 5408,5412 ---- * @brief Construct. * ! * Creates an @c mfstring with @p n copies of @p value. * * @param[in] n the number elements in @a mfstring::value. *************** *** 5444,5447 **** --- 5426,5431 ---- /** + * @fn openvrml::mfstring::mfstring(const value_type & value) + * * @brief Construct. * *************** *** 5450,5457 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfstring::mfstring(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 5434,5437 ---- *************** *** 5639,5643 **** * @brief Construct. * ! * Creates an <code>mftime</code> with @p n copies of @p value. * * @param[in] n the number of elements in @a mftime::value. --- 5619,5623 ---- * @brief Construct. * ! * Creates an @c mftime with @p n copies of @p value. * * @param[in] n the number of elements in @a mftime::value. *************** *** 5656,5659 **** --- 5636,5641 ---- /** + * @fn openvrml::mftime::mftime(const value_type & value) + * * @brief Construct. * *************** *** 5662,5669 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mftime::mftime(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 5644,5647 ---- *************** *** 5852,5856 **** * @brief Construct. * ! * Creates an <code>mfvec2f</code> with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec2f::value. --- 5830,5834 ---- * @brief Construct. * ! * Creates an @c mfvec2f with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec2f::value. *************** *** 5869,5872 **** --- 5847,5852 ---- /** + * @fn openvrml::mfvec2f::mfvec2f(const value_type & value) + * * @brief Construct. * *************** *** 5875,5882 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfvec2f::mfvec2f(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 5855,5858 ---- *************** *** 6063,6067 **** * @brief Construct. * ! * Creates an <code>mfvec2d</code> with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec2d::value. --- 6039,6043 ---- * @brief Construct. * ! * Creates an @c mfvec2d with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec2d::value. *************** *** 6080,6083 **** --- 6056,6061 ---- /** + * @fn openvrml::mfvec2d::mfvec2d(const value_type & value) + * * @brief Construct. * *************** *** 6086,6093 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfvec2d::mfvec2d(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 6064,6067 ---- *************** *** 6275,6279 **** * @brief Construct. * ! * Creates an <code>mfvec3f</code> with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec3f::value. --- 6249,6253 ---- * @brief Construct. * ! * Creates an @c mfvec3f with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec3f::value. *************** *** 6292,6295 **** --- 6266,6271 ---- /** + * @fn openvrml::mfvec3f::mfvec3f(const value_type & value) + * * @brief Construct. * *************** *** 6298,6305 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfvec3f::mfvec3f(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 6274,6277 ---- *************** *** 6487,6491 **** * @brief Construct. * ! * Creates an <code>mfvec3d</code> with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec3d::value. --- 6459,6463 ---- * @brief Construct. * ! * Creates an @c mfvec3d with @p n copies of @p value. * * @param[in] n the number elements in @a mfvec3d::value. *************** *** 6504,6507 **** --- 6476,6481 ---- /** + * @fn openvrml::mfvec3d::mfvec3d(const value_type & value) + * * @brief Construct. * *************** *** 6510,6517 **** * @exception std::bad_alloc if memory allocation fails. */ - openvrml::mfvec3d::mfvec3d(const value_type & value) - OPENVRML_THROW1(std::bad_alloc): - field_value(value, value_type_constructor_tag()) - {} /** --- 6484,6487 ---- Index: field_value.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/field_value.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** field_value.h 15 May 2007 04:06:11 -0000 1.23 --- field_value.h 6 Jun 2007 06:28:27 -0000 1.24 *************** *** 825,828 **** --- 825,833 ---- OPENVRML_NOTHROW; + inline mfbool::mfbool(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfcolor : public field_value { *************** *** 861,864 **** --- 866,874 ---- OPENVRML_NOTHROW; + inline mfcolor::mfcolor(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfcolorrgba : public field_value { *************** *** 899,902 **** --- 909,917 ---- OPENVRML_NOTHROW; + inline mfcolorrgba::mfcolorrgba(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mffloat : public field_value { *************** *** 935,938 **** --- 950,958 ---- OPENVRML_NOTHROW; + inline mffloat::mffloat(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfdouble : public field_value { *************** *** 971,974 **** --- 991,999 ---- OPENVRML_NOTHROW; + inline mfdouble::mfdouble(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfimage : public field_value { *************** *** 1007,1010 **** --- 1032,1040 ---- OPENVRML_NOTHROW; + inline mfimage::mfimage(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfint32 : public field_value { *************** *** 1041,1044 **** --- 1071,1079 ---- OPENVRML_NOTHROW; + inline openvrml::mfint32::mfint32(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfnode : public field_value { *************** *** 1077,1080 **** --- 1112,1120 ---- OPENVRML_NOTHROW; + inline openvrml::mfnode::mfnode(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfrotation : public field_value { *************** *** 1115,1118 **** --- 1155,1163 ---- OPENVRML_NOTHROW; + inline mfrotation::mfrotation(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfstring : public field_value { *************** *** 1151,1154 **** --- 1196,1204 ---- OPENVRML_NOTHROW; + inline mfstring::mfstring(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mftime : public field_value { *************** *** 1186,1189 **** --- 1236,1244 ---- OPENVRML_NOTHROW; + inline mftime::mftime(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfvec2f : public field_value { *************** *** 1222,1225 **** --- 1277,1285 ---- OPENVRML_NOTHROW; + inline mfvec2f::mfvec2f(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfvec2d : public field_value { *************** *** 1258,1261 **** --- 1318,1326 ---- OPENVRML_NOTHROW; + inline mfvec2d::mfvec2d(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + class OPENVRML_API mfvec3f : public field_value { *************** *** 1294,1297 **** --- 1359,1368 ---- OPENVRML_NOTHROW; + inline mfvec3f::mfvec3f(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} + + class OPENVRML_API mfvec3d : public field_value { public: *************** *** 1328,1331 **** --- 1399,1407 ---- OPENVRML_API bool operator!=(const mfvec3d & lhs, const mfvec3d & rhs) OPENVRML_NOTHROW; + + inline mfvec3d::mfvec3d(const value_type & value) + OPENVRML_THROW1(std::bad_alloc): + field_value(value, value_type_constructor_tag()) + {} } |