bobcatlcgen(1)

bobcatlcgen1

Generator for the fbb::lc template class

Usage

bobcatlcgen nTypes [class-file]

Overview

In the Bobcat header file <bobcat/lc> a template class is defined that can be used to define and declare a local context struct to be used with the unary and binary argument context wrappers FBB::FnWrap1c and FBB::FnWrap2c. The <bobcat/lc> header file provides for local context structs up to 10 template type parameters.

bobcatlcgen can be used locally to enlarge this default number (reducing the maximum is also possible but in practice probably pointless). It expects the maximum number of template type parameters for the FBB::LC template class as defined in the newly generated header file.

The header file generated by bobcatlcgen can be used in lieu of the header file provided by the bobcat archive or (-dev) distribution.

Examples

Assume the following command was specified:

    bobcatlcgen 5 local-lc

This generates the file `local-lc’ in the current directory defining FBB::LC for at most 5 template type parameters. The following file (e.g., main.cc) in the current directory will use local-lc rather than <bobcat/lc>:

    #include <iostream>
    #include <vector>
    #include <string>
    #include <algorithm>
    #include <bobcat/fnwrap1c>
    #include "local-lc"
    using namespace std;
    using namespace FBB;
    class Strings
    {
        typedef LC<size_t, ostream &> lc;
        vector<string> d_vs;
        public:
            Strings()
            {
                d_vs.push_back("one");
                d_vs.push_back("two");
                d_vs.push_back("");
                d_vs.push_back("three");
            }
            void display(ostream &out) const
            {
                lc c(1, out);
                find_if(d_vs.begin(), d_vs.end(),
                    FnWrap1c<string const &, lc &, bool>
                         (&Strings::untilEmpty, c));
            }
        private:
            static bool untilEmpty(string const &str, lc &c)
            {
                if (str.empty())
                    return true;        // stop
                c.f2 << c.f1++ << " " << str << endl;
                return false;           // don’t stop
            }
    };
    int main()
    {
        Strings s;
        s.display(cout);
    }

When comparing the above example to the example provided in the lc(3bobcat) man page note that the only difference is that here the header file local-lc rather than <bobcat/lc> is included.

Distribution files

o

bobcat_2.08.01-x.dsc: detached signature;

o

bobcat_2.08.01-x.tar.gz: source archive;

o

bobcat_2.08.01-x_i386.changes: change log;

o

libbobcat1_2.08.01-x_*.deb: debian package holding the libraries;

o

libbobcat1-dev_2.08.01-x_*.deb: debian package holding the libraries, headers and manual pages;

o

http://sourceforge.net/projects/bobcat: public archive location;

Bobcat

Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.

Bugs

None Reported.

Author

Frank B. Brokken ([email protected]).

From libbobcat-dev 2.08.01-1 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.