repeat.3bobcat

Langue: en

Version: 347989 (ubuntu - 24/10/10)

Section: 3 (Bibliothèques de fonctions)

NAME

FBB::repeat - call a (member) function a number of times

SYNOPSIS

#include <bobcat/foreach>

DESCRIPTION

The FBB::repeat function templates allows a function or function object to be called a certain number of times.

The STL repeat function templates requires a counter set to the number of times a function or function object is activated. No argument and no local context is passed to the function (object). The for_each function templates can be used for that.

The FBB::repeat function templates are defined inline, allowing the compiler to `optimize away' the repeat function call itself.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

-

OVERLOADED FUNCTIONS

In the following description several template type parameters are used. They are:
o
Counter represents the counter's type. Usually it is an int or size_t.
o
Function represents a pointer to a classless or static class member function or a function object;
o
Class represents a class type;
o
Member represents a pointer to a Class member function.
o
void repeat(Counter counter, Function &fun):
fun is called counter times. No argument is passed to fun.
o
void repeat(Counter counter, Class &object, Member member):
object.*member is called counter times, passing no argument to object.*member.
o
void repeat(Counter counter, Class *object, Member member):
object->*member is called counter times, passing no argument to object->*member. Class and Member may also be defined as const objects.

EXAMPLES

 #include <iostream>
 #include <bobcat/repeat>
 
 using namespace std;
 using namespace FBB;
 
 class Object
 {
     public:
         void member();
 };
 
 void Object::member()
 {
     cout << "member called\n";
 }
 
 int main(int argc, char **argv)
 {
     Object object;
 
     repeat(argc, object, &Object::member);
 }
 
 

FILES

bobcat/repeat - defines the class interface

SEE ALSO

bobcat(7), fnwrap1(3bobcat), fnwrap1c(3bobcat), fnwrap2(3bobcat), fnwrap2c(3bobcat), foreach(3bobcat)

BUGS

None Reported.

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'. This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).