Add primitive types for pack and unpack
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@900 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
c775354e77
commit
8991eae405
2 changed files with 42 additions and 2 deletions
|
|
@ -38,9 +38,13 @@
|
|||
#define __mess_h
|
||||
|
||||
#include <utility>
|
||||
#include <string>
|
||||
|
||||
/* Char */
|
||||
extern void pack (const char & __c);
|
||||
extern void pack (const char & __c);
|
||||
|
||||
/* Boolean */
|
||||
extern void pack (const bool & __b, int __nitem = 1);
|
||||
|
||||
/* Float */
|
||||
extern void pack (const float & __f, int __nitem = 1);
|
||||
|
|
@ -67,7 +71,8 @@ extern void pack (const long & __l, int __nitem = 1);
|
|||
extern void pack (const unsigned long & __ul, int __nitem = 1);
|
||||
|
||||
/* String */
|
||||
extern void pack (const char * __str);
|
||||
extern void pack (const char * __str);
|
||||
extern void pack (const std::string & __str);
|
||||
|
||||
/* Pointer */
|
||||
template <class T> void pack (const T * __ptr) {
|
||||
|
|
@ -87,6 +92,9 @@ template <class U, class V> void pack (const std :: pair <U, V> & __pair) {
|
|||
/* Char */
|
||||
extern void unpack (char & __c);
|
||||
|
||||
/* Boolean */
|
||||
extern void unpack (bool & __b, int __nitem = 1);
|
||||
|
||||
/* Float */
|
||||
extern void unpack (float & __f, int __nitem = 1);
|
||||
|
||||
|
|
@ -113,6 +121,7 @@ extern void unpack (unsigned long & __ul, int __nitem = 1);
|
|||
|
||||
/* String */
|
||||
extern void unpack (char * __str);
|
||||
extern void unpack (std::string & __str);
|
||||
|
||||
/* Pointer */
|
||||
template <class T> void unpack (T * & __ptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue