- Main Page
- Namespaces
- Classes
- Files

- Search for |

# eoVector_comm.h

    00001 // "eoVector_comm.h"
    00002
    00003 // (c) OPAC Team, LIFL, August 2005
    00004
    00005 /*
    00006    Contact: paradiseo-help@lists.gforge.inria.fr
    00007 */
    00008
    00009 #ifndef __eoVector_comm_h
    00010 #define __eoVector_comm_h
    00011
    00012 #include <eoVector.h>
    00013
    00014 #include "messaging.h"
    00015
    00016 template <class F, class T> void pack (const eoVector <F, T> & __v) {
    00017
    00018   pack (__v.fitness ()) ;
    00019   unsigned len = __v.size ();
    00020   pack (len);
    00021   for (unsigned i = 0 ; i < len; i ++)
    00022     pack (__v [i]);
    00023 }
    00024
    00025 template <class F, class T> void unpack (eoVector <F, T> & __v) {
    00026
    00027   F fit;
    00028   unpack (fit);
    00029   __v.fitness (fit);
    00030
    00031   unsigned len;
    00032   unpack (len);
    00033   __v.resize (len);
    00034   for (unsigned i = 0 ; i < len; i ++)
    00035     unpack (__v [i]);
    00036 }
    00037
    00038 #endif