|
Boost-Commit : |
From: chochlik_at_[hidden]
Date: 2008-05-02 15:11:46
Author: matus.chochlik
Date: 2008-05-02 15:11:45 EDT (Fri, 02 May 2008)
New Revision: 45036
URL: http://svn.boost.org/trac/boost/changeset/45036
Log:
Changed the template argument name to comply with the boost naming convention,
including the examples.
Text files modified:
sandbox/mirror/libs/mirror/example/registering/classes.cpp | 60 ++++++++++++++++++++--------------------
sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp | 10 +++---
sandbox/mirror/libs/mirror/example/serialization/cube.cpp | 40 +++++++++++++-------------
sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp | 10 +++---
4 files changed, 60 insertions(+), 60 deletions(-)
Modified: sandbox/mirror/libs/mirror/example/registering/classes.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/registering/classes.cpp (original)
+++ sandbox/mirror/libs/mirror/example/registering/classes.cpp 2008-05-02 15:11:45 EDT (Fri, 02 May 2008)
@@ -185,15 +185,15 @@
* some info about the given meta_object into
* a stream.
*/
-template <class a_meta_object>
+template <class MetaObject>
struct pretty_printer
{
- typedef a_meta_object meta_object;
+ typedef MetaObject meta_object;
//
// prints some info about the meta-object t
// to the given stream
- template <class out_stream>
- out_stream& print(out_stream& s) const
+ template <class OutStream>
+ OutStream& print(OutStream& s) const
{
typedef pretty_printer<meta_object> prn_type;
typedef typename prn_type::meta_object meta_object;
@@ -236,40 +236,40 @@
//
// does not print anything for other meta-objects
// than meta_classes
- template <class out_stream, class meta_object>
- out_stream& print_base_classes(out_stream& s, meta_object*) const {return s;}
+ template <class OutStream, class MetaObject>
+ OutStream& print_base_classes(OutStream& s, MetaObject*) const {return s;}
//
// a function object that gets called by mirror::for_each
// for every base class of the given class
- template <class out_stream>
+ template <class OutStream>
struct base_class_printer
{
- out_stream& s;
- base_class_printer(out_stream& _s):s(_s){ }
+ OutStream& s;
+ base_class_printer(OutStream& _s):s(_s){ }
//
- template <class meta_inheritance>
- void operator()(meta_inheritance) const
+ template <class MetaInheritance>
+ void operator()(MetaInheritance) const
{
// the argument is a specialization of the
// meta_inheritance<> template
// it's base_class typedef is the type
// of the base class
using namespace ::std;
- typedef typename meta_inheritance::meta_base_class meta_class;
+ typedef typename MetaInheritance::meta_base_class meta_class;
s << endl << " - " << name_to_stream<meta_class>();
}
};
//
// prints info about base classes
- template <class out_stream, class base_class>
- out_stream& print_base_classes(out_stream& s, meta_class<base_class>*) const
+ template <class OutStream, class Class>
+ OutStream& print_base_classes(OutStream& s, meta_class<Class>*) const
{
using namespace ::std;
//
// print out the count of (registered) base classes that
// the inspected class has
//
- typedef typename meta_object::base_classes::list base_class_list;
+ typedef typename MetaObject::base_classes::list base_class_list;
//
s << "It has ";
if(mpl::size<base_class_list>::value == 1)
@@ -279,45 +279,45 @@
else s << "no base classes.";
//
// execute the printer on the list of base classes
- for_each<typename meta_object::base_classes>(base_class_printer<out_stream>(s));
+ for_each<typename meta_object::base_classes>(base_class_printer<OutStream>(s));
//
return s << endl;
}
//
// does not print anything for non meta_class meta-objects
- template <class out_stream, class meta_object>
- out_stream& print_attribs(out_stream& s, meta_object*) const {return s;}
+ template <class OutStream, class MetaObject>
+ OutStream& print_attribs(OutStream& s, MetaObject*) const {return s;}
//
//
// a functor that gets called for every meta_attribute
// of the given meta_class
- template <class out_stream>
+ template <class OutStream>
struct attrib_printer
{
- out_stream& s;
+ OutStream& s;
// the constructor takes reference to the output stream
- attrib_printer(out_stream& _s):s(_s){ }
+ attrib_printer(OutStream& _s):s(_s){ }
//
// function call operator
- template <class meta_attribute>
- void operator()(meta_attribute ma) const
+ template <class MetaAttribute>
+ void operator()(MetaAttribute ma) const
{
using namespace ::std;
s << endl << " - " <<
- name_to_stream< BOOST_MIRROR_REFLECT_TYPE(typename meta_attribute::type) >() <<
+ name_to_stream< BOOST_MIRROR_REFLECT_TYPE(typename MetaAttribute::type) >() <<
" " <<
ma.base_name();
}
};
//
// this overload prints the list of attributes of the given class
- template <class out_stream, class base_class>
- out_stream& print_attribs(out_stream& s, meta_class<base_class>*) const
+ template <class OutStream, class Class>
+ OutStream& print_attribs(OutStream& s, meta_class<Class>*) const
{
//
// print the number of the registered attributes
//
- typedef typename meta_object::attributes::type_list attrib_type_list;
+ typedef typename MetaObject::attributes::type_list attrib_type_list;
//
s << "It has ";
if(mpl::size<attrib_type_list>::value == 1)
@@ -329,7 +329,7 @@
// execute the printer on the list of member attributes
// note that the type of functor and the implementation
// of for_each is likely subject to changes
- for_each<typename meta_object::attributes>(attrib_printer<out_stream>(s));
+ for_each<typename MetaObject::attributes>(attrib_printer<OutStream>(s));
return s << ::std::endl;
}
@@ -337,8 +337,8 @@
// now some easy stuff, overload the << operator
// for our pretty_printer
-template <class meta_object, class out_stream>
-out_stream& operator << (out_stream& s, const pretty_printer<meta_object>& prn)
+template <class MetaObject, class OutStream>
+OutStream& operator << (OutStream& s, const pretty_printer<MetaObject>& prn)
{
return prn.print(s) << ::std::endl << "----------------------";
}
Modified: sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp (original)
+++ sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp 2008-05-02 15:11:45 EDT (Fri, 02 May 2008)
@@ -174,18 +174,18 @@
struct attrib_printer
{
- template <class meta_attribute>
- void operator()(meta_attribute ma) const
+ template <class MetaAttribute>
+ void operator()(MetaAttribute ma) const
{
using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
- typedef BOOST_MIRROR_REFLECT_TYPE(typename meta_attribute::type) mt;
+ typedef BOOST_MIRROR_REFLECT_TYPE(typename MetaAttribute::type) mt;
bcout <<
" " <<
- meta_attribute::position::value <<
+ MetaAttribute::position::value <<
": " <<
- meta_attribute::meta_class::full_name() <<
+ MetaAttribute::meta_class::full_name() <<
" " <<
ma.base_name() <<
";" <<
Modified: sandbox/mirror/libs/mirror/example/serialization/cube.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/serialization/cube.cpp (original)
+++ sandbox/mirror/libs/mirror/example/serialization/cube.cpp 2008-05-02 15:11:45 EDT (Fri, 02 May 2008)
@@ -43,11 +43,11 @@
namespace Graphics {
// coordinates
- template <typename a_float_type>
+ template <typename FloatType>
class CoordsTempl
{
public:
- typedef a_float_type float_type;
+ typedef FloatType float_type;
CoordsTempl(
float_type _x = 0.0,
float_type _y = 0.0,
@@ -264,30 +264,30 @@
};
-template <class meta_class, class position>
+template <class MetaClass, class Position>
struct single_attrib_loader
{
template <class Archive, class Class>
single_attrib_loader(Archive & ar, Class& c)
{
// first load the previous
- single_attrib_loader<meta_class, mpl::int_<position::value - 1> >(ar, c);
+ single_attrib_loader<MetaClass, mpl::int_<Position::value - 1> >(ar, c);
// query the value of the current member
typedef typename mpl::at<
- typename meta_class::all_attributes::type_list,
- position
+ typename MetaClass::all_attributes::type_list,
+ Position
>::type member_type;
member_type value;
// load it
typename to_be_loaded<member_type>::type dst(value);
ar >> dst;
// and set it
- meta_class::all_attributes::set(c, position(), value);
+ MetaClass::all_attributes::set(c, Position(), value);
}
};
-template <class meta_class>
-struct single_attrib_loader<meta_class, mpl::int_<0> >
+template <class MetaClass>
+struct single_attrib_loader<MetaClass, mpl::int_<0> >
{
template <class Archive, class Class>
single_attrib_loader(Archive & ar, Class& c)
@@ -295,13 +295,13 @@
typedef mpl::int_<0> position;
// we are on the first so just load it
typedef typename mpl::at<
- typename meta_class::all_attributes::type_list,
+ typename MetaClass::all_attributes::type_list,
position
>::type member_type;
member_type value;
typename to_be_loaded<member_type>::type dst(value);
ar >> dst;
- meta_class::all_attributes::set(c, position(), value);
+ MetaClass::all_attributes::set(c, position(), value);
}
};
@@ -327,30 +327,30 @@
};
-template <class meta_class, class position>
+template <class MetaClass, class Position>
struct single_attrib_saver
{
template <class Archive, class Class>
single_attrib_saver(Archive & ar, Class& c)
{
// first save the previous
- single_attrib_saver<meta_class, mpl::int_<position::value - 1> >(ar, c);
+ single_attrib_saver<MetaClass, mpl::int_<Position::value - 1> >(ar, c);
// query the value of the current member
typedef typename mpl::at<
- typename meta_class::all_attributes::type_list,
- position
+ typename MetaClass::all_attributes::type_list,
+ Position
>::type member_type;
member_type value;
// and save it
typename to_be_saved<member_type>::type src(
- meta_class::all_attributes::query(c, position(), value)
+ MetaClass::all_attributes::query(c, Position(), value)
);
ar << src;
}
};
-template <class meta_class>
-struct single_attrib_saver<meta_class, mpl::int_<0> >
+template <class MetaClass>
+struct single_attrib_saver<MetaClass, mpl::int_<0> >
{
template <class Archive, class Class>
single_attrib_saver(Archive & ar, Class& c)
@@ -359,12 +359,12 @@
// we are on the first so just save it
// query the value of the current member
typedef typename mpl::at<
- typename meta_class::all_attributes::type_list,
+ typename MetaClass::all_attributes::type_list,
position
>::type member_type;
member_type value;
typename to_be_saved<member_type>::type src(
- meta_class::all_attributes::query(c, position(), value)
+ MetaClass::all_attributes::query(c, position(), value)
);
ar << src;
}
Modified: sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp (original)
+++ sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp 2008-05-02 15:11:45 EDT (Fri, 02 May 2008)
@@ -28,15 +28,15 @@
#include <boost/mirror/meta_classes/boost_tuple.hpp>
-template <class a_class>
+template <class Class>
class attrib_value_printer
{
public:
- attrib_value_printer(a_class& _inst)
+ attrib_value_printer(Class& _inst)
: inst(_inst){ }
- template <typename meta_attribute>
- void operator()(meta_attribute ma) const
+ template <typename MetaAttribute>
+ void operator()(MetaAttribute ma) const
{
using namespace ::std;
using namespace ::boost;
@@ -49,7 +49,7 @@
endl;
}
private:
- a_class& inst;
+ Class& inst;
};
struct str_printer
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk