GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ITERATOR (3)

NAME

FBB::Iterator - Iterator returning plain values when dereferenced

FBB::ReverseIterator - reverse_iterator for FBB::Iterator

CONTENTS

SYNOPSIS

#include <bobcat/iterator>

DESCRIPTION

The FBB::Iterator<Type> class template implements a bidirectional iterator for plain data types. Dereferencing FBB::Iterator objects returns values of type Type, e.g., char or int. This iterator comes in handy in case you need to initialize an objects with a range of values, which are of some basic type (see also the EXAMPLE section).

FBB::ReverseIterator implements a reverse iterator for FBB::Iterator.

NAMESPACE

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

INHERITS FROM

std::iterator<std::bidirectional_iterator_tag, ...>

CONSTRUCTORS

Constructors for Iterator<Type>:
o explicit Iterator(Tye const &value):
This constructor initializes the Iterator object with an initial Type value. When dereferencing this iterator, value is returned.

The default implementations of the Iterator<Type>\(cqs default, copy, and move constructors are available.
Constructors for ReverseIterator<Type>:
o explicit ReverseIterator(Type const &value):
This constructor initializes the ReverseIterator object with an initial Type value. When dereferencing this iterator immediately following its construction, the decremented value is returned (without modifying the internally stored Type value);
o explicit ReverseIterator(Iterator<Type> const &iter):
This constructor initializes the ReverseIterator object with an initial Iterator<Type> object. When dereferencing this iterator immediately following its construction, the decremented Iterator\(cqs value is returned (without modifying the Type value that is stored inside the Iterator).

The default implementations of the ReverseIterator<Type>\(cqs default, copy, and move constructors are available.

MEMBER FUNCTIONS

For template parameter type Type all members of std::iterator<std:::reverse_iterator_tag, Type> are available, as FBB::Iterator and FBB::ReverseIterator inherit from this class.

o Iterator<Type> &operator++():
The (prefix) increment operator increments the iterator\(cqs value and returns a reference to itself;
o Iterator<Type> &operator++(int):
The (postfix) increment operator increments the iterator\(cqs value and returns a copy of itself, initialized with the iterator\(cqs value before it was incremented;
o Iterator<Type> &operator--():
The (prefix) decrement operator decrements the iterator\(cqs value and returns a reference to itself;
o Iterator<Type> &operator--(int):
The (postfix) decrement operator decrements the iterator\(cqs value and returns a copy of itself, initialized with the iterator\(cqs value before it was decremented;
o bool operator==(Iterator<Type> const &rhs) const:
This operator returns true if the value of the current Iterator object is equal to the value of the rhs Iterator object;
o bool operator!=(Iterator<Type> const &rhs) const:
This operator returns true if the value of the current Iterator object is not equal to the value of the rhs Iterator object;
o Type &operator*():
The derefence operator returns a reference to the Iterator\(cqs value.
o Type const &operator*() const:
This derefence operator returns a reference to the Iterator\(cqs immutable value.

STATIC MEMBER FUNCTIONS

Static members of Iterator<Type>:
o Iterator<Type> last(Type value):
An Iterator<Type> object is returned initialized with ++value, so it can be conveniently be used to create an inclusive iterator range (see also section EXAMPLE);
o Iterator<Type> max():
An Iterator<Type> object is returned initialized with the value returned by std::numeric_limits<Type>::max();
o Iterator<Type> min():
An Iterator<Type> object is returned initialized with the value returned by std::numeric_limits<Type>::min()

Static member of ReverseIterator<Type>:
o ReverseIterator<Type> last(Type const &value):
A ReverseIterator<Type> object is returned initialized with Iterator<Type>::last(value), so it can be conveniently be used to create an inclusive reverse iterator range (see also section EXAMPLE);

EXAMPLE

#include <algorithm>
#include <iterator>
#include <iostream>
#include <string>

#include <bobcat/iterator>

using namespace std; using namespace FBB;

int main() { copy(Iterator<int>(10), Iterator<int>(20), ostream_iterator<int>(cout, \(dq, \(dq)); cout << \(cq\n\(cq;

copy(Iterator<char>(*Iterator<char>::max() - 9), Iterator<char>::last(*Iterator<char>::max()), ostream_iterator<int>(cout, \(dq, \(dq)); cout << \(cq\n\(cq;

cout << *Iterator<int>::max() << \(cq\n\(cq; copy(Iterator<int>(*Iterator<int>::max() - 9), Iterator<int>::last(*Iterator<int>::max()), ostream_iterator<int>(cout, \(dq, \(dq)); cout << \(cq\n\(cq;

copy(ReverseIterator<int>(20), ReverseIterator<int>(10), ostream_iterator<int>(cout, \(dq, \(dq)); cout << \(cq\n\(cq;

std::string letters(Iterator<char>(\(cqa\(cq), Iterator<char>::last(\(cqz\(cq)); cout << letters << \(cq\n\(cq;

std::string caps(ReverseIterator<char>::last(\(cqZ\(cq), ReverseIterator<char>(\(cqA\(cq)); cout << caps << \(cq\n\(cq;

}

FILES

bobcat/iterator - defines the class interface

SEE ALSO

bobcat(7)

BUGS

None Reported.

DISTRIBUTION FILES

o bobcat_3.25.01-x.dsc: detached signature;
o bobcat_3.25.01-x.tar.gz: source archive;
o bobcat_3.25.01-x_i386.changes: change log;
o libbobcat1_3.25.01-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.25.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\(cqs Own Base Classes And Templates\(cq.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

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

Search for    or go to Top of page |  Section 3 |  Main Index


libbobcat-dev_3&.25&.01-x&.tar&.gz FBB::ITERATOR (3bobcat) 2005-2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.