- Main Page
- Namespaces
- Classes
- Files

- Search for |

# messaging.h

    00001 // "messaging.h"
    00002
    00003 // (c) OPAC Team, LIFL, August 2005
    00004
    00005 /*
    00006    Contact: paradiseo-help@lists.gforge.inria.fr
    00007 */
    00008
    00009 #ifndef __mess_h
    00010 #define __mess_h
    00011
    00012 #include <utility>
    00013
    00014 /* Char */
    00015 extern void pack (const char & __c);
    00016
    00017 /* Float */
    00018 extern void pack (const float & __f, int __nitem = 1);
    00019
    00020 /* Double */
    00021 extern void pack (const double & __d, int __nitem = 1);
    00022
    00023 /* Integer */
    00024 extern void pack (const int & __i, int __nitem = 1);
    00025
    00026 /* Unsigned int. */
    00027 extern void pack (const unsigned int & __ui, int __nitem = 1);
    00028
    00029 /* Short int. */
    00030 extern void pack (const short & __sh, int __nitem = 1);
    00031
    00032 /* Unsigned short */
    00033 extern void pack (const unsigned short & __ush, int __nitem = 1);
    00034
    00035 /* Long */
    00036 extern void pack (const long & __l, int __nitem = 1);
    00037
    00038 /* Unsigned long */
    00039 extern void pack (const unsigned long & __ul, int __nitem = 1);
    00040
    00041 /* String */
    00042 extern void pack (const char * __str);
    00043
    00044 /* Pointer */
    00045 template <class T> void pack (const T * __ptr) {
    00046
    00047   pack ((unsigned long) __ptr);
    00048 }
    00049
    00050 /* Pair */
    00051 template <class U, class V> void pack (const std :: pair <U, V> & __pair) {
    00052
    00053   pack (__pair.first);
    00054   pack (__pair.second);
    00055 }
    00056
    00057 //
    00058
    00059 /* Float */
    00060 extern void unpack (char & __c);
    00061
    00062 /* Float */
    00063 extern void unpack (float & __f, int __nitem = 1);
    00064
    00065 /* Double */
    00066 extern void unpack (double & __d, int __nitem = 1);
    00067
    00068 /* Integer */
    00069 extern void unpack (int & __i, int __nitem = 1);
    00070
    00071 /* Unsigned int. */
    00072 extern void unpack (unsigned int & __ui, int __nitem = 1);
    00073
    00074 /* Short int. */
    00075 extern void unpack (short & __sh, int __nitem = 1);
    00076
    00077 /* Unsigned short */
    00078 extern void unpack (unsigned short & __ush, int __nitem = 1);
    00079
    00080 /* Long */
    00081 extern void unpack (long & __l, int __nitem = 1);
    00082
    00083 /* Unsigned long */
    00084 extern void unpack (unsigned long & __ul, int __nitem = 1);
    00085
    00086 /* String */
    00087 extern void unpack (char * __str);
    00088
    00089 /* Pointer */
    00090 template <class T> void unpack (T * & __ptr) {
    00091
    00092   unsigned long p;
    00093   unpack (p);
    00094   __ptr = (T *) p;
    00095 }
    00096
    00097 /* Pair */
    00098 template <class U, class V> void unpack (std :: pair <U, V> & __pair) {
    00099
    00100   unpack (__pair.first);
    00101   unpack (__pair.second);
    00102 }
    00103
    00104 #endif