Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages | Search for

# t-eoFunctor.cpp

    00001
    00002 #include <eoInit.h>
    00003 #include <eoCounter.h>
    00004
    00005 void f(eoInit<int>& func)
    00006 {
    00007     int i;
    00008     func(i);
    00009 }
    00010
    00011 class Tester : public eoInit<int>
    00012 {
    00013 public :
    00014     void operator()(int& i)
    00015     {
    00016         i=1;
    00017     }
    00018 };
    00019
    00020 #include <iostream>
    00021 #include <eoFixedLength.h>
    00022 #include <eoVariableLength.h>
    00023
    00024 using namespace std;
    00025
    00026 int main(void)
    00027 {
    00028     Tester test;
    00029
    00030     eoFunctorStore store;
    00031
    00033     eoInit<int>& cntr = make_counter(functor_category(test), test, store);
    00034
    00035     eoUnaryFunctorCounter<eoInit<int> > cntr2(test);
    00036
    00037     f(cntr);
    00038     f(cntr2);
    00039     f(cntr2);
    00040     f(test);
    00041
    00042     typedef eoVariableLength<double, int> EoType;
    00043     EoType eo;
    00044
    00045     eo.push_back(1);
    00046     eo.push_back(2);
    00047
    00048     return 1;
    00049 }