Changeset 38746


Ignore:
Timestamp:
Aug 17, 2007, 5:52:00 PM (11 years ago)
Author:
mconsoni
Message:
  • 80 columns.
  • Replaced tabs.
  • Enhanced comments.
Location:
sandbox/libs/reflection/doc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sandbox/libs/reflection/doc/interpreter.qbk

    r38663 r38746  
    2727issues).
    2828
    29 To show the current syntax we think that the best is to show an example session.
     29To show the current syntax we think that the best is to show an example
     30session.
    3031
    3132In this session we create some instances and call the car::start method. Also
     
    6970
    7071Of course this interpreter is very limited, but it shows the potential of
    71 Boost.Reflection to develop software that use the meta-information of its structure.
     72Boost.Reflection to develop software that use the meta-information of its
     73structure.
    7274
    7375[endsect]
  • sandbox/libs/reflection/doc/introduction.qbk

    r38582 r38746  
    2222functionalities and it's not much than an interesting prototype on the subject.
    2323
    24 The documentation is, also, completely incomplete. Sorry. Look at tutorial #1 for
    25 examples of basic usage.
     24The documentation is, also, completely incomplete. Sorry. Look at tutorial #1
     25for examples of basic usage.
    2626
    2727[endsect]
  • sandbox/libs/reflection/doc/tutorial1.qbk

    r38582 r38746  
    3030    if(started_) {
    3131      std::cout << "Turning " << name_ << " "<< angle << " degrees."
    32                 << std::endl;
     32                << std::endl;
    3333      return true;
    3434    } else {
    3535      std::cout << "Cannot turn before starting the engine of "
    36                 << name_ << "." << std::endl;
     36                << name_ << "." << std::endl;
    3737      return false;
    3838    }
     
    7070that the return type is bool. We also have to provide a pointer to the method.
    7171
    72 Then we add the second method. It's described by an string ("turn" in this case),
    73 and it returns a bool. Also we say that it receives a float and it's described
    74 by a string ("turn_angle").
     72Then we add the second method. It's described by an string ("turn" in this
     73case), and it returns a bool. Also we say that it receives a float and it's
     74described by a string ("turn_angle").
    7575
    76 Having the methods stored in our reflection we can now see how to call them. We have
    77 two ways.
     76Having the methods stored in our reflection we can now see how to call them.
     77We have two ways.
    7878
    7979First, let's define one instance to use the reflection on:
     
    9898``
    9999
    100 Now we have to define with template arguments the way that we describe the method
    101 and the parameters. Also we have to provide the instance, the method description and
    102 the value of the parameter.
     100Now we have to define with template arguments the way that we describe the
     101method and the parameters. Also we have to provide the instance, the method
     102description and the value of the parameter.
    103103
    104104Of course, this approach is a bit limited, because we have to provide a lot of
     
    109109most of the time. Because of that we implemented a second way to call methods.
    110110
    111 First we define a parameter_map. We will store there the possible parameters. Note
    112 that we're defining an unneeded parameter. It'll be simply ignored.
     111First we define a parameter_map. We will store there the possible parameters.
     112Note that we're defining an unneeded parameter. It'll be simply ignored.
    113113
    114114``
  • sandbox/libs/reflection/doc/tutorial2.qbk

    r38633 r38746  
    2525{
    2626public:
    27         suv(const std::string name) : car(name) {}
    28         virtual std::string get_type(void) { return "It's a SUV."; }
    29         virtual ~suv(void) {}
     27        suv(const std::string name) : car(name) {}
     28        virtual std::string get_type(void) { return "It's a SUV."; }
     29        virtual ~suv(void) {}
    3030};
    3131
     
    3333{
    3434public:
    35         compact(const std::string name) : car(name) {}
    36         virtual std::string get_type(void) { return "It's a compact."; }
    37         virtual ~compact(void) {}
     35        compact(const std::string name) : car(name) {}
     36        virtual std::string get_type(void) { return "It's a compact."; }
     37        virtual ~compact(void) {}
    3838};
    3939``
     
    7070``
    7171  load_single_library(fm, "libcar_lib.extension",
    72                       "extension_export_car");
     72                      "extension_export_car");
    7373  std::list<factory<car, std::string, std::string> > & factory_list =
    74           fm.get<car, std::string, std::string>(); 
     74          fm.get<car, std::string, std::string>(); 
    7575``
    7676
     
    8181``
    8282  for (std::list<factory<car, std::string, std::string> >
    83         ::iterator current_car = factory_list.begin();
     83        ::iterator current_car = factory_list.begin();
    8484       current_car != factory_list.end();
    8585       ++current_car)
Note: See TracChangeset for help on using the changeset viewer.