packmsg.h File Reference

Go to the source code of this file.

Defines

#define ALIGN_8(x)   (((unsigned long)x + 7) & (~7))
#define PACKMSG_CHECKSUM(X)
#define PACK_MSG(MSGTYPE, MSGDATA)
#define PACK_MEMORY(BUF, SIZE)
#define PACK_THIS   PACK_MEMORY(packmsg_msg,sizeof(*packmsg_msg));
#define PACK(DATA)   PACK_MEMORY(&(packmsg_msg->DATA),sizeof(packmsg_msg->DATA))
#define PACK_RESIZE(DATA)
#define PACK_ARRAY(DATA, LEN)
#define PACK_AND_NEW_ARRAY(DATA, LEN)

Functions

template<class T>
size_t sizeof_element (ResizeArray< T > &)
template<class T>
T * new_array (T *, int n)


Define Documentation

#define ALIGN_8 ( x   )     (((unsigned long)x + 7) & (~7))

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 25 of file packmsg.h.

Referenced by ProxyResultMsg::unpack().

#define PACK ( DATA   )     PACK_MEMORY(&(packmsg_msg->DATA),sizeof(packmsg_msg->DATA))

Definition at line 123 of file packmsg.h.

Referenced by PatchMap::pack().

#define PACK_AND_NEW_ARRAY ( DATA,
LEN   ) 

Value:

{ \
  PACK(LEN)\
  if ( packmsg_pass == 2 ) { \
    packmsg_msg->DATA = new_array(packmsg_msg->DATA,packmsg_msg->LEN); \
  } \
  PACK_MEMORY(packmsg_msg->DATA,packmsg_msg->LEN*sizeof(*(packmsg_msg->DATA))); \
}

Definition at line 139 of file packmsg.h.

#define PACK_ARRAY ( DATA,
LEN   ) 

Value:

{ \
  PACK(LEN); \
  PACK_MEMORY(packmsg_msg->DATA,packmsg_msg->LEN*sizeof(*(packmsg_msg->DATA))); \
}

Definition at line 134 of file packmsg.h.

#define PACK_MEMORY ( BUF,
SIZE   ) 

Value:

{ \
  int ASIZE = ALIGN_8(SIZE); \
  switch ( packmsg_pass ) { \
  case 0: \
    packmsg_size += (ASIZE); \
    break; \
  case 1: \
    CmiMemcpy((void *)packmsg_cur,(void *)(BUF),(SIZE)); \
    packmsg_cur += (ASIZE); \
    break; \
  case 2: \
    CmiMemcpy((void *)(BUF),(void *)packmsg_cur,(SIZE)); \
    packmsg_cur += (ASIZE); \
    break; \
  default: \
    break; \
  } \
}

Definition at line 102 of file packmsg.h.

#define PACK_MSG ( MSGTYPE,
MSGDATA   ) 

Definition at line 35 of file packmsg.h.

#define PACK_RESIZE ( DATA   ) 

Value:

{ \
  int packmsg_array_len = packmsg_msg->DATA.size(); \
  PACK_MEMORY(&packmsg_array_len,sizeof(packmsg_array_len)); \
  if ( packmsg_pass == 2 ) packmsg_msg->DATA.resize(packmsg_array_len); \
  int packmsg_array_size = \
    packmsg_array_len * sizeof_element(packmsg_msg->DATA); \
  PACK_MEMORY(packmsg_msg->DATA.begin(),packmsg_array_size); \
}

Definition at line 125 of file packmsg.h.

#define PACK_THIS   PACK_MEMORY(packmsg_msg,sizeof(*packmsg_msg));

Definition at line 121 of file packmsg.h.

#define PACKMSG_CHECKSUM (  ) 

Definition at line 27 of file packmsg.h.


Function Documentation

template<class T>
T* new_array ( T *  ,
int  n 
) [inline]

Definition at line 33 of file packmsg.h.

00033 { return new T[n]; }

template<class T>
size_t sizeof_element ( ResizeArray< T > &   )  [inline]

Definition at line 31 of file packmsg.h.

00031 { return sizeof(T); }


Generated on Fri Sep 22 01:17:16 2017 for NAMD by  doxygen 1.4.7