|
Boost-Commit : |
From: mariano.consoni_at_[hidden]
Date: 2007-08-17 13:52:00
Author: mconsoni
Date: 2007-08-17 13:52:00 EDT (Fri, 17 Aug 2007)
New Revision: 38746
URL: http://svn.boost.org/trac/boost/changeset/38746
Log:
- 80 columns.
- Replaced tabs.
- Enhanced comments.
Text files modified:
sandbox/libs/reflection/doc/interpreter.qbk | 6 ++++--
sandbox/libs/reflection/doc/introduction.qbk | 4 ++--
sandbox/libs/reflection/doc/tutorial1.qbk | 24 ++++++++++++------------
sandbox/libs/reflection/doc/tutorial2.qbk | 18 +++++++++---------
4 files changed, 27 insertions(+), 25 deletions(-)
Modified: sandbox/libs/reflection/doc/interpreter.qbk
==============================================================================
--- sandbox/libs/reflection/doc/interpreter.qbk (original)
+++ sandbox/libs/reflection/doc/interpreter.qbk 2007-08-17 13:52:00 EDT (Fri, 17 Aug 2007)
@@ -26,7 +26,8 @@
constrainted by the number of parameters (mostly because of pattern matching
issues).
-To show the current syntax we think that the best is to show an example session.
+To show the current syntax we think that the best is to show an example
+session.
In this session we create some instances and call the car::start method. Also
we show what happens when we predicated over unknown instances.
@@ -68,6 +69,7 @@
Of course this interpreter is very limited, but it shows the potential of
-Boost.Reflection to develop software that use the meta-information of its structure.
+Boost.Reflection to develop software that use the meta-information of its
+structure.
[endsect]
Modified: sandbox/libs/reflection/doc/introduction.qbk
==============================================================================
--- sandbox/libs/reflection/doc/introduction.qbk (original)
+++ sandbox/libs/reflection/doc/introduction.qbk 2007-08-17 13:52:00 EDT (Fri, 17 Aug 2007)
@@ -21,7 +21,7 @@
Unfortunately, the library is not fully developed yet. It only has the basic
functionalities and it's not much than an interesting prototype on the subject.
-The documentation is, also, completely incomplete. Sorry. Look at tutorial #1 for
-examples of basic usage.
+The documentation is, also, completely incomplete. Sorry. Look at tutorial #1
+for examples of basic usage.
[endsect]
Modified: sandbox/libs/reflection/doc/tutorial1.qbk
==============================================================================
--- sandbox/libs/reflection/doc/tutorial1.qbk (original)
+++ sandbox/libs/reflection/doc/tutorial1.qbk 2007-08-17 13:52:00 EDT (Fri, 17 Aug 2007)
@@ -29,11 +29,11 @@
{
if(started_) {
std::cout << "Turning " << name_ << " "<< angle << " degrees."
- << std::endl;
+ << std::endl;
return true;
} else {
std::cout << "Cannot turn before starting the engine of "
- << name_ << "." << std::endl;
+ << name_ << "." << std::endl;
return false;
}
}
@@ -69,12 +69,12 @@
parameters indicate that we will identify this method by an int (3 in this case) and
that the return type is bool. We also have to provide a pointer to the method.
-Then we add the second method. It's described by an string ("turn" in this case),
-and it returns a bool. Also we say that it receives a float and it's described
-by a string ("turn_angle").
+Then we add the second method. It's described by an string ("turn" in this
+case), and it returns a bool. Also we say that it receives a float and it's
+described by a string ("turn_angle").
-Having the methods stored in our reflection we can now see how to call them. We have
-two ways.
+Having the methods stored in our reflection we can now see how to call them.
+We have two ways.
First, let's define one instance to use the reflection on:
@@ -97,9 +97,9 @@
float, std::string>(&porsche_911, "turn", .5f);
``
-Now we have to define with template arguments the way that we describe the method
-and the parameters. Also we have to provide the instance, the method description and
-the value of the parameter.
+Now we have to define with template arguments the way that we describe the
+method and the parameters. Also we have to provide the instance, the method
+description and the value of the parameter.
Of course, this approach is a bit limited, because we have to provide a lot of
information to call the actual method.
@@ -108,8 +108,8 @@
could be mined with that requeriments. Simply we don't have such information
most of the time. Because of that we implemented a second way to call methods.
-First we define a parameter_map. We will store there the possible parameters. Note
-that we're defining an unneeded parameter. It'll be simply ignored.
+First we define a parameter_map. We will store there the possible parameters.
+Note that we're defining an unneeded parameter. It'll be simply ignored.
``
boost::extension::parameter_map pm;
Modified: sandbox/libs/reflection/doc/tutorial2.qbk
==============================================================================
--- sandbox/libs/reflection/doc/tutorial2.qbk (original)
+++ sandbox/libs/reflection/doc/tutorial2.qbk 2007-08-17 13:52:00 EDT (Fri, 17 Aug 2007)
@@ -24,17 +24,17 @@
class suv : public car
{
public:
- suv(const std::string name) : car(name) {}
- virtual std::string get_type(void) { return "It's a SUV."; }
- virtual ~suv(void) {}
+ suv(const std::string name) : car(name) {}
+ virtual std::string get_type(void) { return "It's a SUV."; }
+ virtual ~suv(void) {}
};
class compact : public car
{
public:
- compact(const std::string name) : car(name) {}
- virtual std::string get_type(void) { return "It's a compact."; }
- virtual ~compact(void) {}
+ compact(const std::string name) : car(name) {}
+ virtual std::string get_type(void) { return "It's a compact."; }
+ virtual ~compact(void) {}
};
``
@@ -69,9 +69,9 @@
``
load_single_library(fm, "libcar_lib.extension",
- "extension_export_car");
+ "extension_export_car");
std::list<factory<car, std::string, std::string> > & factory_list =
- fm.get<car, std::string, std::string>();
+ fm.get<car, std::string, std::string>();
``
Now, the interesting part. We iterate the factories searching for
@@ -80,7 +80,7 @@
``
for (std::list<factory<car, std::string, std::string> >
- ::iterator current_car = factory_list.begin();
+ ::iterator current_car = factory_list.begin();
current_car != factory_list.end();
++current_car)
{
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